Fixed up configs so that script folder has its own file

This commit is contained in:
Bertie690 2025-08-12 10:26:11 -04:00
parent 5f97a97fff
commit 0c3782172b
4 changed files with 57 additions and 8 deletions

View File

@ -19,6 +19,7 @@
// and having to verify whether each individual file is ignored // and having to verify whether each individual file is ignored
"includes": [ "includes": [
"**", "**",
"!**/*.d.ts",
"!**/dist/**/*", "!**/dist/**/*",
"!**/build/**/*", "!**/build/**/*",
"!**/coverage/**/*", "!**/coverage/**/*",
@ -176,10 +177,9 @@
} }
}, },
// Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes), // Overrides to prevent unused import removal inside `overrides.ts` and enums files (for TSDoc linkcodes)
// as well as in all boilerplate files
{ {
"includes": ["**/src/overrides.ts", "**/src/enums/**/*", "**/*.boilerplate.ts", "**/*.d.ts"], "includes": ["**/src/overrides.ts", "**/src/enums/**/*"],
"linter": { "linter": {
"rules": { "rules": {
"correctness": { "correctness": {
@ -189,7 +189,7 @@
} }
}, },
{ {
"includes": ["**/src/overrides.ts", "**/scripts/**/*.ts"], "includes": ["**/src/overrides.ts"],
"linter": { "linter": {
"rules": { "rules": {
"style": { "style": {

38
scripts/biome.jsonc Normal file
View File

@ -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"
}
}
}
}
]
}

12
scripts/jsconfig.json Normal file
View File

@ -0,0 +1,12 @@
{
"extends": "../tsconfig",
"include": ["**/*.{js,jsx}"],
"compilerOptions": {
"checkJs": true,
"target": "esnext",
"module": "nodenext",
"moduleResolution": "nodenext",
"erasableSyntaxOnly": true,
"strict": true
}
}

View File

@ -18,7 +18,6 @@
"esModuleInterop": true, "esModuleInterop": true,
"strictNullChecks": true, "strictNullChecks": true,
"sourceMap": false, "sourceMap": false,
"checkJs": true,
"strict": false, // TODO: Enable this eventually "strict": false, // TODO: Enable this eventually
"rootDir": ".", "rootDir": ".",
"outDir": "./build", "outDir": "./build",
@ -55,9 +54,9 @@
"#utils/*": ["./src/utils/*.ts"], "#utils/*": ["./src/utils/*.ts"],
"#data/*": ["./src/data/pokemon-forms/*.ts", "./src/data/pokemon/*.ts", "./src/data/*.ts"], "#data/*": ["./src/data/pokemon-forms/*.ts", "./src/data/pokemon/*.ts", "./src/data/*.ts"],
"#test/*": ["./test/*.ts"], "#test/*": ["./test/*.ts"],
"#app/*": ["./src/*.ts"], "#app/*": ["./src/*.ts"]
"#scripts/*": ["./scripts/*.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"]
} }