Migrate biome.jsonc to 2.0

This commit is contained in:
NightKev 2025-06-17 13:00:52 -07:00
parent d7524f3c54
commit 6ebb31132f

View File

@ -1,5 +1,5 @@
{ {
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
"vcs": { "vcs": {
"enabled": false, "enabled": false,
"clientKind": "git", "clientKind": "git",
@ -10,35 +10,35 @@
"enabled": true, "enabled": true,
"useEditorconfig": true, "useEditorconfig": true,
"indentStyle": "space", "indentStyle": "space",
"ignore": ["src/enums/*", "src/data/balance/*"], "includes": ["**", "!**/src/enums/**/*", "!**/src/data/balance/**/*"],
"lineWidth": 120 "lineWidth": 120
}, },
"files": { "files": {
"ignoreUnknown": true, "ignoreUnknown": true,
// Adding folders to the ignore list is GREAT for performance because it prevents biome from descending into them // Adding folders to the ignore list is GREAT for performance because it prevents biome from descending into them
// and having to verify whether each individual file is ignored // and having to verify whether each individual file is ignored
"ignore": [ "includes": [
"**/*.d.ts", "**",
"dist/*", "!**/*.d.ts",
"build/*", "!**/dist/**/*",
"coverage/*", "!**/build/**/*",
"public/*", "!**/coverage/**/*",
".github/*", "!**/public/**/*",
"node_modules/*", "!**/.github/**/*",
".vscode/*", "!**/node_modules/**/*",
"*.css", // TODO? "!**/.vscode/**/*",
"*.html", // TODO? // TODO: lint css and html?
// TODO: these files are too big and complex, ignore them until their respective refactors "!**/*.css",
"src/data/moves/move.ts", "!**/*.html",
// TODO: enable linting this file
// this file is just too big: "!**/src/data/moves/move.ts",
"src/data/balance/tms.ts" // this file is too big
"!**/src/data/balance/tms.ts"
] ]
}, },
// While it'd be nice to enable consistent sorting, enabling this causes issues due to circular import resolution order // TODO: Configure and enable import sorting
// TODO: Remove if we ever get down to 0 circular imports "assist": { "actions": { "source": { "organizeImports": "off" } } },
"organizeImports": { "enabled": false },
"linter": { "linter": {
"enabled": true, "enabled": true,
"rules": { "rules": {
@ -51,7 +51,6 @@
"noUnusedImports": "error" "noUnusedImports": "error"
}, },
"style": { "style": {
"noVar": "error",
"useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome "useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome
"useBlockStatements": "error", "useBlockStatements": "error",
"useConst": "error", "useConst": "error",
@ -63,7 +62,23 @@
"useSingleVarDeclarator": "off", "useSingleVarDeclarator": "off",
"useNodejsImportProtocol": "off", "useNodejsImportProtocol": "off",
"useTemplate": "off", // string concatenation is faster: https://stackoverflow.com/questions/29055518/are-es6-template-literals-faster-than-string-concatenation "useTemplate": "off", // string concatenation is faster: https://stackoverflow.com/questions/29055518/are-es6-template-literals-faster-than-string-concatenation
"noNamespaceImport": "error" "useAsConstAssertion": "error",
"useSelfClosingElements": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error",
"noRestrictedTypes": {
"level": "error",
"options": {
"types": {
"integer": {
"message": "This is an alias for 'number' that can provide false impressions of what values can actually be contained in this variable. Use 'number' instead.",
"use": "number"
}
}
}
}
}, },
"suspicious": { "suspicious": {
"noDoubleEquals": "error", "noDoubleEquals": "error",
@ -77,7 +92,8 @@
"noImplicitAnyLet": "warn", // TODO: Refactor and make this an error "noImplicitAnyLet": "warn", // TODO: Refactor and make this an error
"noRedeclare": "info", // TODO: Refactor and make this an error "noRedeclare": "info", // TODO: Refactor and make this an error
"noGlobalIsNan": "off", "noGlobalIsNan": "off",
"noAsyncPromiseExecutor": "warn" // TODO: Refactor and make this an error "noAsyncPromiseExecutor": "warn", // TODO: Refactor and make this an error
"noVar": "error"
}, },
"complexity": { "complexity": {
"noExcessiveCognitiveComplexity": "warn", // TODO: Refactor and make this an error "noExcessiveCognitiveComplexity": "warn", // TODO: Refactor and make this an error
@ -87,18 +103,8 @@
"noUselessConstructor": "error", "noUselessConstructor": "error",
"noBannedTypes": "warn" // TODO: Refactor and make this an error "noBannedTypes": "warn" // TODO: Refactor and make this an error
}, },
"nursery": { "performance": {
"noRestrictedTypes": { "noNamespaceImport": "error"
"level": "error",
"options": {
"types": {
"integer": {
"message": "This is an alias for 'number' that can provide false impressions of what values can actually be contained in this variable. Use 'number' instead.",
"use": "number"
}
}
}
}
} }
} }
}, },
@ -107,15 +113,15 @@
}, },
"overrides": [ "overrides": [
{ {
"include": ["test/**/*.test.ts"], "includes": ["**/test/**/*.test.ts"],
"javascript": { "globals": [] },
"linter": { "linter": {
"rules": { "rules": {
"performance": { "performance": {
"noDelete": "off" // TODO: evaluate if this is necessary for the test(s) to function "noDelete": "off", // TODO: evaluate if this is necessary for the test(s) to function
"noNamespaceImport": "off" // this is required for `vi.spyOn` to work in some tests
}, },
"style": { "style": {
"noNamespaceImport": "off" // this is required for `vi.spyOn` to work in some tests "noNonNullAssertion": "off"
} }
} }
} }
@ -123,7 +129,7 @@
// 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)
{ {
"include": ["src/overrides.ts", "src/enums/*"], "includes": ["**/src/overrides.ts", "**/src/enums/**/*"],
"linter": { "linter": {
"rules": { "rules": {
"correctness": { "correctness": {
@ -133,7 +139,7 @@
} }
}, },
{ {
"include": ["src/overrides.ts"], "includes": ["**/src/overrides.ts"],
"linter": { "linter": {
"rules": { "rules": {
"style": { "style": {