|
1 | 1 | {
|
| 2 | + "root": true, |
2 | 3 | "parser": "@typescript-eslint/parser",
|
3 | 4 | "parserOptions": {
|
4 | 5 | "warnOnUnsupportedTypeScriptVersion": false,
|
5 |
| - "ecmaVersion": 6, |
6 | 6 | "sourceType": "module"
|
7 | 7 | },
|
8 | 8 | "env": {
|
|
11 | 11 | "es6": true
|
12 | 12 | },
|
13 | 13 | "plugins": [
|
14 |
| - "@typescript-eslint", "jsdoc", "no-null", "import", "eslint-plugin-local" |
| 14 | + "@typescript-eslint", "no-null", "import", "eslint-plugin-local" |
15 | 15 | ],
|
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"] } |
| 16 | + "ignorePatterns": [ |
| 17 | + "**/node_modules/**", |
| 18 | + "/built/**", |
| 19 | + "/tests/**", |
| 20 | + "/lib/**", |
| 21 | + "/src/lib/*.generated.d.ts", |
| 22 | + "/scripts/**/*.js", |
| 23 | + "/scripts/**/*.d.*", |
| 24 | + "/internal/**", |
| 25 | + "/coverage/**" |
26 | 26 | ],
|
27 | 27 | "rules": {
|
| 28 | + "sort-imports": ["error", { |
| 29 | + "ignoreCase": true, |
| 30 | + "ignoreDeclarationSort": true, |
| 31 | + "allowSeparatedGroups": true |
| 32 | + }], |
| 33 | + |
28 | 34 | "@typescript-eslint/adjacent-overload-signatures": "error",
|
29 | 35 | "@typescript-eslint/array-type": "error",
|
| 36 | + "@typescript-eslint/no-array-constructor": "error", |
30 | 37 |
|
31 | 38 | "brace-style": "off",
|
32 | 39 | "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }],
|
|
62 | 69 | "@typescript-eslint/prefer-for-of": "error",
|
63 | 70 | "@typescript-eslint/prefer-function-type": "error",
|
64 | 71 | "@typescript-eslint/prefer-namespace-keyword": "error",
|
| 72 | + "@typescript-eslint/prefer-as-const": "error", |
65 | 73 |
|
66 | 74 | "quotes": "off",
|
67 | 75 | "@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }],
|
68 | 76 |
|
69 | 77 | "semi": "off",
|
70 | 78 | "@typescript-eslint/semi": "error",
|
| 79 | + "@typescript-eslint/no-extra-semi": "error", |
71 | 80 |
|
72 | 81 | "space-before-function-paren": "off",
|
73 | 82 | "@typescript-eslint/space-before-function-paren": ["error", {
|
|
80 | 89 | "@typescript-eslint/type-annotation-spacing": "error",
|
81 | 90 | "@typescript-eslint/unified-signatures": "error",
|
82 | 91 |
|
| 92 | + "@typescript-eslint/no-extra-non-null-assertion": "error", |
| 93 | + |
83 | 94 | // scripts/eslint/rules
|
84 | 95 | "local/object-literal-surrounding-space": "error",
|
85 | 96 | "local/no-type-assertion-whitespace": "error",
|
|
94 | 105 | "local/simple-indent": "error",
|
95 | 106 | "local/debug-assert": "error",
|
96 | 107 | "local/no-keywords": "error",
|
97 |
| - "local/one-namespace-per-file": "error", |
| 108 | + "local/jsdoc-format": "error", |
98 | 109 |
|
99 | 110 | // eslint-plugin-import
|
100 | 111 | "import/no-extraneous-dependencies": ["error", { "optionalDependencies": false }],
|
101 | 112 |
|
102 | 113 | // eslint-plugin-no-null
|
103 | 114 | "no-null/no-null": "error",
|
104 | 115 |
|
105 |
| - // eslint-plugin-jsdoc |
106 |
| - "jsdoc/check-alignment": "error", |
107 |
| - |
108 | 116 | // eslint
|
109 | 117 | "constructor-super": "error",
|
110 | 118 | "curly": ["error", "multi-line"],
|
|
143 | 151 | "quote-props": ["error", "consistent-as-needed"],
|
144 | 152 | "space-in-parens": "error",
|
145 | 153 | "unicode-bom": ["error", "never"],
|
146 |
| - "use-isnan": "error" |
147 |
| - } |
| 154 | + "use-isnan": "error", |
| 155 | + "no-prototype-builtins": "error", |
| 156 | + "no-self-assign": "error", |
| 157 | + "no-dupe-else-if": "error" |
| 158 | + }, |
| 159 | + "overrides": [ |
| 160 | + // By default, the ESLint CLI only looks at .js files. But, it will also look at |
| 161 | + // any files which are referenced in an override config. Most users of typescript-eslint |
| 162 | + // get this behavior by default by extending a recommended typescript-eslint config, which |
| 163 | + // just so happens to override some core ESLint rules. We don't extend from any config, so |
| 164 | + // explicitly reference TS files here so the CLI picks them up. |
| 165 | + // |
| 166 | + // ESLint in VS Code will lint any opened file (so long as it's not eslintignore'd), so |
| 167 | + // that will work regardless of the below. |
| 168 | + // |
| 169 | + // The same applies to mjs files; ESLint appears to not scan those either. |
| 170 | + { "files": ["*.ts", "*.mts", "*.cts", "*.mjs", "*.cjs"] }, |
| 171 | + { |
| 172 | + "files": ["*.mjs", "*.mts"], |
| 173 | + "rules": { |
| 174 | + // These globals don't exist outside of CJS files. |
| 175 | + "no-restricted-globals": ["error", |
| 176 | + { "name": "__filename" }, |
| 177 | + { "name": "__dirname" }, |
| 178 | + { "name": "require" }, |
| 179 | + { "name": "module" }, |
| 180 | + { "name": "exports" } |
| 181 | + ] |
| 182 | + } |
| 183 | + } |
| 184 | + ] |
148 | 185 | }
|
0 commit comments