|
16 | 16 | "plugin:@typescript-eslint/stylistic" |
17 | 17 | ], |
18 | 18 | "plugins": [ |
19 | | - "@typescript-eslint", "no-null", "eslint-plugin-local", "simple-import-sort" |
| 19 | + "@typescript-eslint", |
| 20 | + "no-null", |
| 21 | + "eslint-plugin-local", |
| 22 | + "simple-import-sort" |
20 | 23 | ], |
21 | 24 | "ignorePatterns": [ |
22 | 25 | "**/node_modules/**", |
|
84 | 87 | "@typescript-eslint/class-literal-property-style": "off", |
85 | 88 | "@typescript-eslint/consistent-indexed-object-style": "off", |
86 | 89 | "@typescript-eslint/no-duplicate-enum-values": "off", |
| 90 | + "@typescript-eslint/no-empty-function": "off", |
87 | 91 | "@typescript-eslint/no-namespace": "off", |
88 | 92 | "@typescript-eslint/no-non-null-asserted-optional-chain": "off", |
89 | 93 | "@typescript-eslint/no-var-requires": "off", |
90 | 94 | "@typescript-eslint/no-empty-interface": "off", |
91 | 95 | "@typescript-eslint/no-explicit-any": "off", |
| 96 | + "@typescript-eslint/ban-types": [ |
| 97 | + "error", |
| 98 | + { |
| 99 | + "extendDefaults": true, |
| 100 | + "types": { |
| 101 | + // This is theoretically good, but ts-eslint appears to mistake our declaration of Symbol for the global Symbol type. |
| 102 | + // See: https://github.com/typescript-eslint/typescript-eslint/issues/7306 |
| 103 | + "Symbol": false, |
| 104 | + "{}": false // {} is a totally useful and valid type. |
| 105 | + } |
| 106 | + } |
| 107 | + ], |
92 | 108 |
|
93 | 109 | // Todo: For each of these, investigate whether we want to enable them ✨ |
94 | | - "@typescript-eslint/ban-types": "off", |
95 | | - "no-useless-escape": "off", |
96 | | - "prefer-rest-params": "off", |
97 | | - "prefer-spread": "off", |
98 | | - "@typescript-eslint/no-empty-function": "off", |
99 | 110 | "@typescript-eslint/no-unused-vars": "off", |
100 | 111 |
|
101 | 112 | // Pending https://github.com/typescript-eslint/typescript-eslint/issues/4820 |
|
105 | 116 | "local/only-arrow-functions": [ |
106 | 117 | "error", |
107 | 118 | { |
108 | | - "allowNamedFunctions": true , |
| 119 | + "allowNamedFunctions": true, |
109 | 120 | "allowDeclarations": true |
110 | 121 | } |
111 | 122 | ], |
|
120 | 131 |
|
121 | 132 | // eslint-plugin-simple-import-sort |
122 | 133 | "simple-import-sort/imports": "error", |
123 | | - "simple-import-sort/exports": "error", |
124 | | - |
125 | | - // Formatting rules; remove once a formatter enforces these. |
126 | | - "curly": ["error", "multi-line"], |
127 | | - "linebreak-style": ["error", "windows"], |
128 | | - "max-statements-per-line": ["error", { "max": 1 }], |
129 | | - "new-parens": "error", |
130 | | - "no-trailing-spaces": "error", |
131 | | - "quote-props": ["error", "consistent-as-needed"], |
132 | | - "space-in-parens": "error", |
133 | | - "@typescript-eslint/brace-style": ["error", "stroustrup", { "allowSingleLine": true }], |
134 | | - "@typescript-eslint/no-extra-semi": "error", |
135 | | - "@typescript-eslint/quotes": ["error", "double", { "avoidEscape": true, "allowTemplateLiterals": true }], |
136 | | - "@typescript-eslint/semi": "error", |
137 | | - "@typescript-eslint/space-before-function-paren": [ |
138 | | - "error", |
139 | | - { |
140 | | - "asyncArrow": "always", |
141 | | - "anonymous": "always", |
142 | | - "named": "never" |
143 | | - } |
144 | | - ], |
145 | | - "local/object-literal-surrounding-space": "error", |
146 | | - "local/no-type-assertion-whitespace": "error", |
147 | | - "local/type-operator-spacing": "error", |
148 | | - "local/no-double-space": "error", |
149 | | - "local/simple-indent": "error" |
| 134 | + "simple-import-sort/exports": "error" |
150 | 135 | }, |
151 | 136 | "overrides": [ |
152 | 137 | // By default, the ESLint CLI only looks at .js files. But, it will also look at |
153 | 138 | // any files which are referenced in an override config. Most users of typescript-eslint |
154 | | - // get this behavior by default by extending a recommended typescript-eslint config, which |
| 139 | + // get this behavior by default by extending a recommended typescript-eslint config, which |
155 | 140 | // just so happens to override some core ESLint rules. We don't extend from any config, so |
156 | 141 | // explicitly reference TS files here so the CLI picks them up. |
157 | 142 | // |
|
164 | 149 | "files": ["*.mjs", "*.mts"], |
165 | 150 | "rules": { |
166 | 151 | // These globals don't exist outside of CJS files. |
167 | | - "no-restricted-globals": ["error", |
| 152 | + "no-restricted-globals": [ |
| 153 | + "error", |
168 | 154 | { "name": "__filename" }, |
169 | 155 | { "name": "__dirname" }, |
170 | 156 | { "name": "require" }, |
|
0 commit comments