@pkmn/eslint-config 8.6.0 → 9.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +300 -285
- package/package.json +9 -12
package/index.js
CHANGED
|
@@ -1,308 +1,323 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
1
|
+
import jest from "eslint-plugin-jest";
|
|
2
|
+
import js from "@eslint/js";
|
|
3
|
+
import import_ from "eslint-plugin-import";
|
|
4
|
+
import stylistic from "@stylistic/eslint-plugin";
|
|
5
|
+
import ts from 'typescript-eslint';
|
|
6
|
+
import globals from 'globals';
|
|
7
|
+
|
|
8
|
+
export default [
|
|
9
|
+
js.configs.recommended,
|
|
10
|
+
{ ignores: ["**/node_modules/"] }, {
|
|
11
|
+
languageOptions: {
|
|
12
|
+
globals: {...globals.node},
|
|
13
|
+
ecmaVersion: 11,
|
|
14
|
+
sourceType: "commonjs",
|
|
15
|
+
parserOptions: {
|
|
16
|
+
ecmaFeatures: {
|
|
17
|
+
globalReturn: true,
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
settings: {jest: {version: 29}},
|
|
22
|
+
plugins: {
|
|
23
|
+
import: import_,
|
|
24
|
+
"@stylistic": stylistic,
|
|
25
|
+
},
|
|
26
|
+
rules: {
|
|
27
|
+
"no-console": "off",
|
|
19
28
|
|
|
20
|
-
|
|
21
|
-
|
|
29
|
+
// bad code, modern (new code patterns we don't like because they're less readable or performant)
|
|
30
|
+
"no-restricted-globals": ["error", "Proxy", "Reflect", "WeakSet"],
|
|
22
31
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
// bad code, deprecated (deprecated/bad patterns that should be written a different way)
|
|
33
|
+
"eqeqeq": "error",
|
|
34
|
+
"func-names": "off", // has minor advantages but way too verbose, hurting readability
|
|
35
|
+
"guard-for-in": "off", // guarding is a deprecated pattern, we just use no-extend-native instead
|
|
36
|
+
"init-declarations": "off", // TypeScript lets us delay initialization safely
|
|
37
|
+
"no-caller": "error",
|
|
38
|
+
"no-eval": "error",
|
|
39
|
+
"no-extend-native": "error",
|
|
40
|
+
"no-implied-eval": "error",
|
|
41
|
+
"no-inner-declarations": ["error", "functions"],
|
|
42
|
+
"no-iterator": "error",
|
|
43
|
+
"no-labels": ["error", {allowLoop: true, allowSwitch: true}],
|
|
44
|
+
"no-multi-str": "error",
|
|
45
|
+
"no-new-func": "error",
|
|
46
|
+
"no-new-wrappers": "error",
|
|
47
|
+
"no-proto": "error",
|
|
48
|
+
"no-restricted-syntax": ["error", "WithStatement"],
|
|
49
|
+
"no-sparse-arrays": "error",
|
|
50
|
+
"no-var": "error",
|
|
51
|
+
"no-with": "error",
|
|
43
52
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
53
|
+
// probably bugs (code with no reason to exist, probably typos)
|
|
54
|
+
"array-callback-return": "error",
|
|
55
|
+
"block-scoped-var": "error", // not actually used; precluded by no-var
|
|
56
|
+
"callback-return": [2, ["callback", "cb", "done"]],
|
|
57
|
+
"consistent-this": "off", // we use arrow functions instead
|
|
58
|
+
"constructor-super": "error",
|
|
59
|
+
"default-case": "off", // hopefully TypeScript will let us skip `default` for things that are exhaustive
|
|
60
|
+
"no-case-declarations": "off", // meh, we have no-shadow
|
|
61
|
+
"no-duplicate-case": "error",
|
|
62
|
+
"no-empty": ["error", {allowEmptyCatch: true}],
|
|
63
|
+
"no-extra-bind": "error",
|
|
64
|
+
"no-extra-label": "error",
|
|
65
|
+
"no-fallthrough": "error",
|
|
66
|
+
"no-label-var": "error",
|
|
67
|
+
"no-new-require": "error",
|
|
68
|
+
"no-new": "error",
|
|
69
|
+
"no-redeclare": "off", // Useful with type namespaces
|
|
70
|
+
"no-self-compare": "error",
|
|
71
|
+
"no-sequences": "error",
|
|
72
|
+
"no-shadow-restricted-names": "error",
|
|
73
|
+
"no-shadow": "error",
|
|
74
|
+
"no-template-curly-in-string": "error",
|
|
75
|
+
"no-throw-literal": "error",
|
|
76
|
+
"no-undef": ["error", {typeof: true}],
|
|
77
|
+
"no-unmodified-loop-condition": "error",
|
|
78
|
+
"no-unused-expressions": "error",
|
|
79
|
+
"no-unsafe-finally": "error",
|
|
80
|
+
"no-unused-labels": "error",
|
|
81
|
+
"no-use-before-define": ["error", {functions: false, classes: false, variables: false}],
|
|
82
|
+
"use-isnan": "error",
|
|
83
|
+
"valid-typeof": "error",
|
|
75
84
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
85
|
+
// style choices
|
|
86
|
+
"no-constant-condition": ["error", {checkLoops: false}],
|
|
87
|
+
"no-lonely-if": "off",
|
|
88
|
+
"radix": ["error", "as-needed"],
|
|
80
89
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
90
|
+
// naming style
|
|
91
|
+
"camelcase": "off", // mostly only so we can import `child_process`
|
|
92
|
+
"id-length": "off",
|
|
93
|
+
"id-match": "off",
|
|
94
|
+
"new-cap": ["error", {newIsCap: true, capIsNew: false}],
|
|
95
|
+
"no-underscore-dangle": "off",
|
|
87
96
|
|
|
88
|
-
|
|
97
|
+
// syntax style (local syntactical, usually autofixable formatting decisions)
|
|
89
98
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
99
|
+
"@stylistic/arrow-parens": "off",
|
|
100
|
+
"arrow-body-style": "error",
|
|
101
|
+
"@stylistic/brace-style": ["error", "1tbs", {allowSingleLine: true}],
|
|
102
|
+
"@stylistic/comma-dangle": ["error", {
|
|
103
|
+
arrays: "always-multiline",
|
|
104
|
+
objects: "always-multiline",
|
|
105
|
+
imports: "always-multiline",
|
|
106
|
+
exports: "always-multiline",
|
|
107
|
+
tuples: "always-multiline",
|
|
108
|
+
functions: "ignore",
|
|
109
|
+
}],
|
|
110
|
+
"@stylistic/comma-style": ["error", "last"],
|
|
111
|
+
"curly": ["error", "multi-line", "consistent"],
|
|
112
|
+
"dot-notation": "off",
|
|
113
|
+
"max-len": ["error", {code: 100, ignoreUrls: true}],
|
|
114
|
+
"@stylistic/new-parens": "error",
|
|
115
|
+
"no-array-constructor": "error",
|
|
116
|
+
"no-div-regex": "error",
|
|
117
|
+
"no-duplicate-imports": "error",
|
|
118
|
+
"no-extra-parens": "off",
|
|
119
|
+
"@stylistic/no-floating-decimal": "error",
|
|
120
|
+
"no-mixed-requires": "error",
|
|
121
|
+
"@stylistic/no-multi-spaces": "error",
|
|
122
|
+
"no-new-object": "error",
|
|
123
|
+
"no-octal-escape": "error",
|
|
124
|
+
"no-return-assign": ["error", "except-parens"],
|
|
125
|
+
"no-undef-init": "off",
|
|
126
|
+
"no-unneeded-ternary": "error",
|
|
127
|
+
"no-useless-call": "error",
|
|
128
|
+
"no-useless-computed-key": "error",
|
|
129
|
+
"no-useless-concat": "off",
|
|
130
|
+
"no-useless-rename": "error",
|
|
131
|
+
"object-shorthand": ["error", "methods"],
|
|
132
|
+
"one-var": "off",
|
|
133
|
+
"operator-assignment": "off",
|
|
134
|
+
"prefer-arrow-callback": "off",
|
|
135
|
+
"prefer-const": ["error", {destructuring: "all"}],
|
|
136
|
+
"quote-props": "off",
|
|
137
|
+
"quotes": "off",
|
|
138
|
+
"semi": ["error", "always"],
|
|
139
|
+
"sort-vars": "off",
|
|
140
|
+
"vars-on-top": "off",
|
|
141
|
+
"@stylistic/wrap-iife": ["error", "inside"],
|
|
142
|
+
"@stylistic/wrap-regex": "off",
|
|
143
|
+
"yoda": ["error", "never", {exceptRange: true}],
|
|
135
144
|
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
145
|
+
// whitespace
|
|
146
|
+
"@stylistic/array-bracket-spacing": ["error", "never"],
|
|
147
|
+
"@stylistic/arrow-spacing": ["error", {before: true, after: true}],
|
|
148
|
+
"@stylistic/block-spacing": ["error", "always"],
|
|
149
|
+
"@stylistic/comma-spacing": ["error", {before: false, after: true}],
|
|
150
|
+
"@stylistic/computed-property-spacing": ["error", "never"],
|
|
151
|
+
"@stylistic/dot-location": ["error", "property"],
|
|
152
|
+
"@stylistic/eol-last": ["error", "always"],
|
|
153
|
+
"@stylistic/func-call-spacing": "error",
|
|
154
|
+
"@stylistic/function-paren-newline": ["error", "consistent"],
|
|
155
|
+
"@stylistic/indent": ["error", 2, {flatTernaryExpressions: true, SwitchCase: 1}],
|
|
156
|
+
"@stylistic/key-spacing": "error",
|
|
157
|
+
"@stylistic/keyword-spacing": ["error", {before: true, after: true}],
|
|
158
|
+
"@stylistic/lines-around-comment": "off",
|
|
159
|
+
"@stylistic/no-mixed-spaces-and-tabs": "error",
|
|
160
|
+
"@stylistic/no-multiple-empty-lines": ["error", {max: 1}],
|
|
161
|
+
"@stylistic/no-trailing-spaces": ["error", {ignoreComments: false}],
|
|
162
|
+
"@stylistic/object-curly-spacing": ["error", "never"],
|
|
163
|
+
"@stylistic/operator-linebreak": ["error", "after", {overrides: {"?": "before", ":": "before"}}],
|
|
164
|
+
"@stylistic/padded-blocks": ["error", "never"],
|
|
165
|
+
"@stylistic/padding-line-between-statements": "off",
|
|
166
|
+
"@stylistic/rest-spread-spacing": ["error", "never"],
|
|
167
|
+
"@stylistic/semi-spacing": ["error", {before: false, after: true}],
|
|
168
|
+
"@stylistic/space-before-blocks": ["error", "always"],
|
|
169
|
+
"@stylistic/space-before-function-paren": ["error", {anonymous: "always", named: "never"}],
|
|
170
|
+
"@stylistic/spaced-comment": ["error", "always", {exceptions: ["*"]}],
|
|
171
|
+
"@stylistic/space-in-parens": ["error", "never"],
|
|
172
|
+
"@stylistic/space-infix-ops": "error",
|
|
173
|
+
"@stylistic/space-unary-ops": ["error", {words: true, nonwords: false}],
|
|
174
|
+
"@stylistic/template-curly-spacing": ["error", "never"],
|
|
166
175
|
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
+
// imports
|
|
177
|
+
"import/order": ["error", {
|
|
178
|
+
"newlines-between": "always",
|
|
179
|
+
"alphabetize": {
|
|
180
|
+
order: "asc",
|
|
181
|
+
caseInsensitive: true,
|
|
182
|
+
},
|
|
183
|
+
}],
|
|
184
|
+
"sort-imports": ["error", {
|
|
185
|
+
ignoreDeclarationSort: true,
|
|
186
|
+
allowSeparatedGroups: true,
|
|
187
|
+
}],
|
|
188
|
+
},
|
|
176
189
|
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
190
|
+
...ts.config({
|
|
191
|
+
files: ["**/*.ts", "**/*.tsx"],
|
|
192
|
+
plugins: {'@typescript-eslint': ts.plugin},
|
|
193
|
+
extends: [
|
|
194
|
+
js.configs.recommended,
|
|
195
|
+
...ts.configs.recommended,
|
|
196
|
+
...ts.configs.recommendedTypeChecked,
|
|
197
|
+
],
|
|
198
|
+
languageOptions: {
|
|
199
|
+
parser: ts.parser,
|
|
200
|
+
ecmaVersion: 11,
|
|
201
|
+
sourceType: "module",
|
|
202
|
+
parserOptions: {
|
|
203
|
+
tsconfigRootDir: ".",
|
|
204
|
+
project: ["./tsconfig.json"],
|
|
205
|
+
warnOnUnsupportedTypeScriptVersion: false,
|
|
187
206
|
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
"@typescript-eslint/member-ordering": "off",
|
|
196
|
-
// "@typescript-eslint/no-extraneous-class": "error",
|
|
197
|
-
// "@typescript-eslint/no-type-alias": "error",
|
|
207
|
+
},
|
|
208
|
+
rules: {
|
|
209
|
+
// TODO revisit
|
|
210
|
+
"@typescript-eslint/explicit-function-return-type": "off",
|
|
211
|
+
"@typescript-eslint/member-ordering": "off",
|
|
212
|
+
// "@typescript-eslint/no-extraneous-class": "error",
|
|
213
|
+
// "@typescript-eslint/no-type-alias": "error",
|
|
198
214
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
215
|
+
"@typescript-eslint/no-namespace": "off",
|
|
216
|
+
"@stylistic/new-parens": "off",// used for the `new class {...}` pattern
|
|
217
|
+
"no-prototype-builtins": "off",
|
|
202
218
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
219
|
+
// typescript-eslint defaults too strict
|
|
220
|
+
"@typescript-eslint/ban-ts-comment": "off",
|
|
221
|
+
"@typescript-eslint/no-empty-function": "off",
|
|
222
|
+
"@typescript-eslint/no-explicit-any": "off",
|
|
223
|
+
"@typescript-eslint/no-unsafe-argument": "off",
|
|
224
|
+
"@typescript-eslint/no-non-null-assertion": "off",
|
|
225
|
+
"@typescript-eslint/no-use-before-define": ["error", {functions: false, classes: false, variables: false}],
|
|
226
|
+
"@typescript-eslint/unbound-method": ["error", {ignoreStatic: true}],
|
|
227
|
+
// disable additional typescript-eslint 3.0 defaults
|
|
228
|
+
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
229
|
+
"@typescript-eslint/no-unsafe-member-access": "off",
|
|
230
|
+
"@typescript-eslint/no-unsafe-assignment": "off",
|
|
231
|
+
"@typescript-eslint/no-unsafe-call": "off",
|
|
232
|
+
"@typescript-eslint/no-unsafe-return": "off",
|
|
217
233
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
"no-unused-expressions": ["error", {"allowTernary": true}], // ternary is used to convert callbacks to Promises
|
|
234
|
+
// probably bugs
|
|
235
|
+
"@typescript-eslint/no-dupe-class-members": "error",
|
|
236
|
+
"@typescript-eslint/no-empty-interface": "error",
|
|
237
|
+
"@typescript-eslint/no-extra-non-null-assertion": "error",
|
|
238
|
+
"@typescript-eslint/no-misused-new": "error",
|
|
239
|
+
"@typescript-eslint/no-non-null-asserted-optional-chain": "error",
|
|
240
|
+
"@typescript-eslint/return-await": ["error", "in-try-catch"],
|
|
241
|
+
"no-dupe-class-members": "off",
|
|
242
|
+
"no-unused-expressions": ["error", {allowTernary: true}], // ternary is used to convert callbacks to Promises
|
|
228
243
|
|
|
229
|
-
|
|
230
|
-
|
|
244
|
+
// naming style
|
|
245
|
+
"@typescript-eslint/camelcase": "off",
|
|
231
246
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
247
|
+
// syntax style (local syntactical, usually autofixable formatting decisions)
|
|
248
|
+
"@typescript-eslint/adjacent-overload-signatures": "error",
|
|
249
|
+
// "@typescript-eslint/array-type": "error",
|
|
250
|
+
"@typescript-eslint/consistent-type-assertions": ["error", {assertionStyle: "as"}],
|
|
251
|
+
"@typescript-eslint/consistent-type-definitions": ["error", "interface"],
|
|
252
|
+
"@typescript-eslint/explicit-member-accessibility": ["error", {accessibility: "no-public"}],
|
|
253
|
+
"@stylistic/member-delimiter-style": "error",
|
|
254
|
+
"@typescript-eslint/parameter-properties": "error",
|
|
255
|
+
"@typescript-eslint/no-this-alias": "error",
|
|
256
|
+
"@typescript-eslint/no-var-requires": "error",
|
|
257
|
+
"@typescript-eslint/prefer-as-const": "error",
|
|
258
|
+
"@typescript-eslint/prefer-for-of": "error",
|
|
259
|
+
"@typescript-eslint/prefer-function-type": "error",
|
|
260
|
+
"@typescript-eslint/prefer-includes": "error",
|
|
261
|
+
"@typescript-eslint/prefer-namespace-keyword": "error",
|
|
262
|
+
"prefer-object-spread": "error",
|
|
263
|
+
"@typescript-eslint/prefer-optional-chain": "error",
|
|
264
|
+
"@typescript-eslint/triple-slash-reference": "error",
|
|
265
|
+
"@typescript-eslint/unified-signatures": "error",
|
|
251
266
|
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
267
|
+
"quotes": "off",
|
|
268
|
+
"@stylistic/quotes": ["error", "single", {avoidEscape: true}],
|
|
269
|
+
"semi": "off",
|
|
270
|
+
"@stylistic/semi": ["error", "always"],
|
|
256
271
|
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
272
|
+
// whitespace
|
|
273
|
+
"@stylistic/type-annotation-spacing": "error",
|
|
274
|
+
"@stylistic/spaced-comment": ["error", "always", {exceptions: ["*", "/"]}],
|
|
260
275
|
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
"@stylistic/block-spacing": "off",
|
|
276
|
+
// overriding base
|
|
277
|
+
"no-use-before-define": "off",
|
|
278
|
+
"no-shadow": "off",
|
|
279
|
+
"@typescript-eslint/no-shadow": ["error"],
|
|
280
|
+
// BUG: conflicts with @stylistic/object-curly-spacing in TypeScript types
|
|
281
|
+
"@stylistic/block-spacing": "off",
|
|
268
282
|
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
283
|
+
// types
|
|
284
|
+
"@typescript-eslint/restrict-plus-operands": "off",
|
|
285
|
+
"@typescript-eslint/prefer-string-starts-ends-with": "off",
|
|
286
|
+
// "@typescript-eslint/switch-exhaustiveness-check": "error",
|
|
273
287
|
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
"@typescript-eslint/no-misused-promises": "error",
|
|
280
|
-
"@typescript-eslint/no-throw-literal": "error",
|
|
288
|
+
// types - probably bugs
|
|
289
|
+
"@typescript-eslint/no-floating-promises": ["error", {ignoreVoid: false, ignoreIIFE: true}],
|
|
290
|
+
"@typescript-eslint/no-for-in-array": "error",
|
|
291
|
+
"@typescript-eslint/no-misused-promises": "error",
|
|
292
|
+
"@typescript-eslint/only-throw-error": "error",
|
|
281
293
|
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
}
|
|
294
|
+
// syntax style (local syntactical, usually autofixable formatting decisions)
|
|
295
|
+
"@typescript-eslint/no-unnecessary-qualifier": "off",
|
|
296
|
+
"@typescript-eslint/no-unnecessary-type-arguments": "error",
|
|
297
|
+
"@typescript-eslint/no-unnecessary-type-assertion": "error",
|
|
298
|
+
"@typescript-eslint/prefer-regexp-exec": "error",
|
|
288
299
|
},
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
],
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
300
|
+
}),
|
|
301
|
+
{
|
|
302
|
+
files: ["**/*.test.js", "**/tests/*.js"],
|
|
303
|
+
...jest.configs['flat/recommended'],
|
|
304
|
+
plugins: {jest},
|
|
305
|
+
languageOptions: {globals: {...jest.environments.globals.globals}},
|
|
306
|
+
rules: {
|
|
307
|
+
...jest.configs['flat/recommended'].rules,
|
|
308
|
+
...jest.configs['flat/style'].rules,
|
|
309
|
+
},
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
files: ["**/*.test.ts", "**/tests/*.ts"],
|
|
313
|
+
...jest.configs['flat/recommended'],
|
|
314
|
+
plugins: {jest},
|
|
315
|
+
languageOptions: {globals: {...jest.environments.globals.globals}},
|
|
316
|
+
rules: {
|
|
317
|
+
...jest.configs['flat/recommended'].rules,
|
|
318
|
+
...jest.configs['flat/style'].rules,
|
|
319
|
+
"@typescript-eslint/unbound-method": "off",
|
|
320
|
+
"jest/unbound-method": "error",
|
|
321
|
+
},
|
|
322
|
+
},
|
|
323
|
+
];
|
package/package.json
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pkmn/eslint-config",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.0.0",
|
|
4
|
+
"type": "module",
|
|
4
5
|
"description": "ESLint configuration from @pkmn based on Pokémon Showdown's style",
|
|
5
6
|
"repository": "github:pkmn/eslint-config",
|
|
6
7
|
"license": "MIT",
|
|
7
|
-
"publishConfig": {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"files": [
|
|
11
|
-
"index.js"
|
|
12
|
-
],
|
|
8
|
+
"publishConfig": {"access": "public"},
|
|
9
|
+
"main": "index.js",
|
|
10
|
+
"files": ["index.js"],
|
|
13
11
|
"peerDependencies": {
|
|
14
|
-
"@stylistic/eslint-plugin": "
|
|
15
|
-
"
|
|
16
|
-
"
|
|
17
|
-
"eslint": "
|
|
18
|
-
"eslint-plugin-import": "<=2.30",
|
|
12
|
+
"@stylistic/eslint-plugin": ">=2.9",
|
|
13
|
+
"typescript-eslint": ">=8.10",
|
|
14
|
+
"eslint": ">=9.12",
|
|
15
|
+
"eslint-plugin-import": ">=2.31",
|
|
19
16
|
"eslint-plugin-jest": ">=28.8",
|
|
20
17
|
"typescript": ">=5.6"
|
|
21
18
|
}
|