diff --git a/eslint.config.mjs b/eslint.config.mjs index 72c40ebb..680add97 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -26,9 +26,11 @@ const projectTypeScriptRules = { "react-hooks/rules-of-hooks": "error", }; const testTypeScriptRelaxations = { + "@typescript-eslint/no-deprecated": "off", "@typescript-eslint/no-unsafe-assignment": "off", "@typescript-eslint/no-unsafe-call": "off", "@typescript-eslint/no-unsafe-member-access": "off", + "@typescript-eslint/no-unsafe-return": "off", "@typescript-eslint/no-unnecessary-type-assertion": "off", "@typescript-eslint/require-await": "off", }; diff --git a/tests/scripts/development-scripts.test.ts b/tests/scripts/development-scripts.test.ts index 97c849b0..eb53a181 100644 --- a/tests/scripts/development-scripts.test.ts +++ b/tests/scripts/development-scripts.test.ts @@ -7,27 +7,6 @@ import { describe, expect, it } from "vitest"; const repoRoot = process.cwd(); describe("development scripts", () => { - it("propagates check:ci script failures", async () => { - const cwd = await tempWorkspace(); - const scripts = await readPackageScripts(); - await writeFile(path.join(cwd, "fail.mjs"), "process.exit(7);\n"); - await writeJson(path.join(cwd, "package.json"), { - scripts: { - "check:ci": scripts["check:ci"], - "typecheck:ci": "node fail.mjs", - "test:ci": 'node -e "process.exit(0)"', - "lint:ci": 'node -e "process.exit(0)"', - "format:check:ci": 'node -e "process.exit(0)"', - "build:styles:check": 'node -e "process.exit(0)"', - build: 'node -e "process.exit(0)"', - }, - }); - - const result = runNpmScript("check:ci", cwd); - - expect(result.status).toBe(7); - }); - it("fails style builds when CSS files are missing from the style order file", async () => { const cwd = await tempWorkspace(); await mkdir(path.join(cwd, "src", "styles"), { recursive: true }); @@ -257,20 +236,6 @@ function runNodeScript(script: string, args: string[] = [], cwd = repoRoot, env: }); } -function runNpmScript(script: string, cwd = repoRoot) { - const npmCommand = process.platform === "win32" ? "npm.cmd" : "npm"; - return spawnSync(npmCommand, ["run", script], { - cwd, - encoding: "utf8", - shell: false, - }); -} - -async function readPackageScripts(): Promise> { - const packageJson = JSON.parse(await readFile(path.join(repoRoot, "package.json"), "utf8")) as { scripts: Record }; - return packageJson.scripts; -} - async function writeJson(file: string, value: unknown): Promise { await writeFile(file, `${JSON.stringify(value, null, 2)}\n`); } diff --git a/tests/scripts/eslint-config.test.ts b/tests/scripts/eslint-config.test.ts index 67b34d02..d0277878 100644 --- a/tests/scripts/eslint-config.test.ts +++ b/tests/scripts/eslint-config.test.ts @@ -5,6 +5,10 @@ import { describe, expect, it } from "vitest"; const repoRoot = process.cwd(); const ESLINT_STARTUP_TEST_TIMEOUT_MS = 10_000; const generatedAppServerImportRoot = "../../generated" + "/app-server"; +const eslint = new ESLint({ + cwd: repoRoot, + overrideConfigFile: path.join(repoRoot, "eslint.config.mjs"), +}); describe("eslint config", () => { it( @@ -538,10 +542,6 @@ export type Item = MessageStreamItem; }); async function lintSource(filePath: string, source: string): Promise { - const eslint = new ESLint({ - cwd: repoRoot, - overrideConfigFile: path.join(repoRoot, "eslint.config.mjs"), - }); const [result] = await eslint.lintText(source, { filePath: path.join(repoRoot, filePath) }); return (result?.messages ?? []).map((message) => message.ruleId ?? message.message); }