|
| 1 | +{ |
| 2 | + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", |
| 3 | + "vcs": { |
| 4 | + "enabled": false, |
| 5 | + "clientKind": "git", |
| 6 | + "useIgnoreFile": true, |
| 7 | + "defaultBranch": "beta" |
| 8 | + }, |
| 9 | + "formatter": { |
| 10 | + "enabled": false, // TODO: enable when https://github.com/biomejs/biome/issues/5879 is implemented |
| 11 | + "useEditorconfig": true, |
| 12 | + "indentStyle": "space", |
| 13 | + "lineWidth": 120 |
| 14 | + }, |
| 15 | + "files": { |
| 16 | + "ignoreUnknown": true, |
| 17 | + // Adding folders to the ignore list is GREAT for performance because it prevents biome from descending into them |
| 18 | + // and having to verify whether each individual file is ignored |
| 19 | + "ignore": [ |
| 20 | + "**/*.d.ts", |
| 21 | + ".github/*", |
| 22 | + ".vscode/*", |
| 23 | + "build/*", |
| 24 | + "coverage/*", |
| 25 | + "dist/*", |
| 26 | + "docs/*", |
| 27 | + "node_modules/*", |
| 28 | + "public/*", |
| 29 | + "typedoc/*", |
| 30 | + "src/data/tms.ts" // this file is just too big |
| 31 | + ] |
| 32 | + }, |
| 33 | + |
| 34 | + "organizeImports": { "enabled": false }, // TODO: Enable in Biome 2.0 |
| 35 | + "linter": { |
| 36 | + "enabled": true, |
| 37 | + "rules": { |
| 38 | + "recommended": true, // see https://biomejs.dev/linter/rules/#recommended-rules |
| 39 | + "correctness": { |
| 40 | + "noUndeclaredVariables": "off", // handled by TypeScript |
| 41 | + "noUnusedVariables": "error", |
| 42 | + "noSwitchDeclarations": "error", |
| 43 | + "noVoidTypeReturn": "warn", // TODO: Refactor and make this an error |
| 44 | + "noUnusedImports": "off" // Handled by ESLint until multi-line disable is added (in Biome 2.0) |
| 45 | + }, |
| 46 | + "style": { |
| 47 | + "noVar": "error", |
| 48 | + "useEnumInitializers": "off", // large enums like Moves/Species would make this cumbersome |
| 49 | + "useBlockStatements": "error", |
| 50 | + "useConst": "error", |
| 51 | + "useImportType": "error", |
| 52 | + "noNonNullAssertion": "off", // TODO: fix all non-null assertions in non-test files and turn this on |
| 53 | + "noParameterAssign": "off", // TODO: add this? |
| 54 | + "useExponentiationOperator": "off", // Too typo-prone and easy to mixup with standard multiplication (* vs **) |
| 55 | + "useDefaultParameterLast": "error", |
| 56 | + "useSingleVarDeclarator": "off", |
| 57 | + "useNodejsImportProtocol": "error", |
| 58 | + "useTemplate": "off", // string concatenation is faster: https://stackoverflow.com/questions/29055518/are-es6-template-literals-faster-than-string-concatenation |
| 59 | + "noNamespaceImport": "error", |
| 60 | + "noInferrableTypes": "off", // Explicit > Implicit |
| 61 | + "useConsistentArrayType": "error", // Standardize on `T[]` |
| 62 | + "useFilenamingConvention": { |
| 63 | + "level": "error", |
| 64 | + "options": { |
| 65 | + "filenameCases": ["kebab-case"], |
| 66 | + "requireAscii": true, |
| 67 | + "strictCase": false |
| 68 | + } |
| 69 | + } |
| 70 | + }, |
| 71 | + "suspicious": { |
| 72 | + "noDoubleEquals": "error", |
| 73 | + "noExplicitAny": "off", // TODO: Refactor and make this an error |
| 74 | + "noAssignInExpressions": "warn", |
| 75 | + "noPrototypeBuiltins": "error", |
| 76 | + "noFallthroughSwitchClause": "error", // Prevents accidental automatic fallthroughs in switch cases (use disable comment if needed) |
| 77 | + "noImplicitAnyLet": "warn", // TODO: Refactor and make this an error |
| 78 | + "noRedeclare": "error", |
| 79 | + "noGlobalIsNan": "error", |
| 80 | + "noAsyncPromiseExecutor": "warn", // TODO: Refactor and make this an error |
| 81 | + "useDefaultSwitchClauseLast": "warn" // TODO: make error? |
| 82 | + }, |
| 83 | + "complexity": { |
| 84 | + "noExcessiveCognitiveComplexity": "info", // TODO: Refactor and make this an error |
| 85 | + "useLiteralKeys": "off", |
| 86 | + "noForEach": "off", // Foreach vs for of is not that simple. |
| 87 | + "noUselessSwitchCase": "off", // Explicit > Implicit |
| 88 | + "noUselessConstructor": "error", |
| 89 | + "noBannedTypes": "warn", // TODO: refactor and make an error |
| 90 | + "useRegexLiterals": "off" // Was broken for some reason; TODO: re-enable |
| 91 | + }, |
| 92 | + "nursery": { |
| 93 | + "noCommonJs": "error" |
| 94 | + } |
| 95 | + } |
| 96 | + }, |
| 97 | + "javascript": { |
| 98 | + "formatter": { "quoteStyle": "double", "arrowParentheses": "always" } |
| 99 | + }, |
| 100 | + "overrides": [ |
| 101 | + { |
| 102 | + "include": ["test/**"], |
| 103 | + "javascript": { "globals": [] }, |
| 104 | + "linter": { |
| 105 | + "rules": { |
| 106 | + "performance": { |
| 107 | + "noDelete": "off" // TODO: evaluate if this is necessary for the test(s) to function |
| 108 | + }, |
| 109 | + "style": { |
| 110 | + "noNamespaceImport": "off", // this is required for `vi.spyOn` to work in some tests |
| 111 | + "noNonNullAssertion": "off" // tests are able to make assumptions about the game state that normally can't be made |
| 112 | + } |
| 113 | + } |
| 114 | + } |
| 115 | + }, |
| 116 | + { |
| 117 | + // This section is to improve the bug tester workflow |
| 118 | + "include": ["src/overrides.ts"], |
| 119 | + "linter": { |
| 120 | + "rules": { |
| 121 | + "correctness": { |
| 122 | + "noUnusedImports": "off" |
| 123 | + }, |
| 124 | + "style": { |
| 125 | + "useImportType": "off" |
| 126 | + } |
| 127 | + } |
| 128 | + } |
| 129 | + } |
| 130 | + ] |
| 131 | +} |
0 commit comments