diff --git a/biome.jsonc b/biome.jsonc index 35a458d2933..d4cb67d33a6 100644 --- a/biome.jsonc +++ b/biome.jsonc @@ -19,6 +19,7 @@ // and having to verify whether each individual file is ignored "includes": [ "**", + "!**/*.d.ts", "!**/dist/**/*", "!**/build/**/*", "!**/coverage/**/*", @@ -176,10 +177,9 @@ } }, - // Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes), - // as well as in all boilerplate files + // Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes) { - "includes": ["**/src/overrides.ts", "**/src/enums/**/*", "**/*.boilerplate.ts", "**/*.d.ts"], + "includes": ["**/src/overrides.ts", "**/src/enums/**/*"], "linter": { "rules": { "correctness": { @@ -189,7 +189,7 @@ } }, { - "includes": ["**/src/overrides.ts", "**/scripts/**/*.ts"], + "includes": ["**/src/overrides.ts"], "linter": { "rules": { "style": { diff --git a/scripts/biome.jsonc b/scripts/biome.jsonc new file mode 100644 index 00000000000..848e2a87184 --- /dev/null +++ b/scripts/biome.jsonc @@ -0,0 +1,38 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json", + // extend from base config in root dir + "extends": "//", + "files": { + "includes": ["**/*.{js,ts,jsx,tsx}"] + }, + "linter": { + "rules": { + "style": { + // Unfortunately, TS does not support multiple configs, so we need to have Biome pull the slack + // and effectively enforce `noErasableSyntax` + "noEnum": "error", + "noNamespace": "error", + "noNonNullAssertion": "error", // TODO: Remove once added to main config + "useForOf": "error" // TODO: Move to main config + }, + "suspicious": { + "noImplicitAnyLet": "error" + } + } + }, + "overrides": [ + // Prevent unused import removal inside boilerplate files. + // These are unused in the file themselves, but will become used once copied and converted to actual TS files. + // (If not, the generated files will themselves produce errors.) + { + "includes": ["**/*.boilerplate.ts", "**/boilerplates/*.ts"], // TODO: Rename existing boilerplates in the folder and remove this 2nd alias + "linter": { + "rules": { + "correctness": { + "noUnusedImports": "off" + } + } + } + } + ] +} diff --git a/scripts/jsconfig.json b/scripts/jsconfig.json new file mode 100644 index 00000000000..34a18a515e7 --- /dev/null +++ b/scripts/jsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../tsconfig", + "include": ["**/*.{js,jsx}"], + "compilerOptions": { + "checkJs": true, + "target": "esnext", + "module": "nodenext", + "moduleResolution": "nodenext", + "erasableSyntaxOnly": true, + "strict": true + } +} diff --git a/tsconfig.json b/tsconfig.json index 9b6a912bac7..0338c306d49 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,7 +18,6 @@ "esModuleInterop": true, "strictNullChecks": true, "sourceMap": false, - "checkJs": true, "strict": false, // TODO: Enable this eventually "rootDir": ".", "outDir": "./build", @@ -55,9 +54,9 @@ "#utils/*": ["./src/utils/*.ts"], "#data/*": ["./src/data/pokemon-forms/*.ts", "./src/data/pokemon/*.ts", "./src/data/*.ts"], "#test/*": ["./test/*.ts"], - "#app/*": ["./src/*.ts"], - "#scripts/*": ["./scripts/*.ts"] + "#app/*": ["./src/*.ts"] } }, - "exclude": ["scripts", "node_modules", "dist", "vite.config.ts", "vitest.config.ts", "vitest.workspace.ts"] + "include": ["**/*.{ts,tsx}"], + "exclude": ["node_modules", "dist", "vite.config.ts", "vitest.config.ts", "vitest.workspace.ts"] }