|
2 | 2 | "parser": "@typescript-eslint/parser", |
3 | 3 | "parserOptions": { |
4 | 4 | "warnOnUnsupportedTypeScriptVersion": false, |
5 | | - "ecmaVersion": 6, |
6 | 5 | "sourceType": "module" |
7 | 6 | }, |
8 | 7 | "env": { |
|
13 | 12 | "plugins": [ |
14 | 13 | "@typescript-eslint", "jsdoc", "no-null", "import", "eslint-plugin-local" |
15 | 14 | ], |
16 | | - "overrides": [ |
17 | | - // By default, the ESLint CLI only looks at .js files. But, it will also look at |
18 | | - // any files which are referenced in an override config. Most users of typescript-eslint |
19 | | - // get this behavior by default by extending a recommended typescript-eslint config, which |
20 | | - // just so happens to override some core ESLint rules. We don't extend from any config, so |
21 | | - // explicitly reference TS files here so the CLI picks them up. |
22 | | - // |
23 | | - // ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so |
24 | | - // that will work regardless of the below. |
25 | | - { "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] } |
26 | | - ], |
27 | 15 | "rules": { |
28 | 16 | "@typescript-eslint/adjacent-overload-signatures": "error", |
29 | 17 | "@typescript-eslint/array-type": "error", |
| 18 | + "@typescript-eslint/no-array-constructor": "error", |
30 | 19 |
|
31 | 20 | "brace-style": "off", |
32 | 21 | "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }], |
|
62 | 51 | "@typescript-eslint/prefer-for-of": "error", |
63 | 52 | "@typescript-eslint/prefer-function-type": "error", |
64 | 53 | "@typescript-eslint/prefer-namespace-keyword": "error", |
| 54 | + "@typescript-eslint/prefer-as-const": "error", |
65 | 55 |
|
66 | 56 | "quotes": "off", |
67 | 57 | "@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }], |
68 | 58 |
|
69 | 59 | "semi": "off", |
70 | 60 | "@typescript-eslint/semi": "error", |
| 61 | + "@typescript-eslint/no-extra-semi": "error", |
71 | 62 |
|
72 | 63 | "space-before-function-paren": "off", |
73 | 64 | "@typescript-eslint/space-before-function-paren": ["error", { |
|
80 | 71 | "@typescript-eslint/type-annotation-spacing": "error", |
81 | 72 | "@typescript-eslint/unified-signatures": "error", |
82 | 73 |
|
| 74 | + "@typescript-eslint/no-extra-non-null-assertion": "error", |
| 75 | + |
83 | 76 | // scripts/eslint/rules |
84 | 77 | "local/object-literal-surrounding-space": "error", |
85 | 78 | "local/no-type-assertion-whitespace": "error", |
|
143 | 136 | "quote-props": ["error", "consistent-as-needed"], |
144 | 137 | "space-in-parens": "error", |
145 | 138 | "unicode-bom": ["error", "never"], |
146 | | - "use-isnan": "error" |
147 | | - } |
| 139 | + "use-isnan": "error", |
| 140 | + "no-prototype-builtins": "error", |
| 141 | + "no-self-assign": "error", |
| 142 | + "no-dupe-else-if": "error" |
| 143 | + }, |
| 144 | + "overrides": [ |
| 145 | + // By default, the ESLint CLI only looks at .js files. But, it will also look at |
| 146 | + // any files which are referenced in an override config. Most users of typescript-eslint |
| 147 | + // get this behavior by default by extending a recommended typescript-eslint config, which |
| 148 | + // just so happens to override some core ESLint rules. We don't extend from any config, so |
| 149 | + // explicitly reference TS files here so the CLI picks them up. |
| 150 | + // |
| 151 | + // ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so |
| 152 | + // that will work regardless of the below. |
| 153 | + // |
| 154 | + // The same applies to mjs files; ESLint appears to not scan those either. |
| 155 | + { "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }, |
| 156 | + { |
| 157 | + "files": ["*.mjs", "*.mts"], |
| 158 | + "rules": { |
| 159 | + // These globals don't exist outside of CJS files. |
| 160 | + "no-restricted-globals": ["error", |
| 161 | + { "name": "__filename" }, |
| 162 | + { "name": "__dirname" }, |
| 163 | + { "name": "require" }, |
| 164 | + { "name": "module" }, |
| 165 | + { "name": "exports" } |
| 166 | + ] |
| 167 | + } |
| 168 | + } |
| 169 | + ] |
148 | 170 | } |
0 commit comments