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