eslint-config-isaacscript 3.7.1 → 4.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.
@@ -0,0 +1,227 @@
1
+ // This ESLint config only contains rules from `eslint-plugin-unicorn`:
2
+ // https://github.com/sindresorhus/eslint-plugin-unicorn
3
+
4
+ // Rules are separated into categories:
5
+ // 1) Normal rules
6
+ // 2) Deprecated rules
7
+
8
+ /** @type {import("eslint").Linter.RulesRecord} */
9
+ const NORMAL_RULES = {
10
+ "unicorn/better-regex": "error",
11
+ "unicorn/catch-error-name": "error",
12
+
13
+ /** Disabled because it has too many false positives. */
14
+ "unicorn/consistent-destructuring": "off",
15
+
16
+ "unicorn/consistent-function-scoping": "error",
17
+ "unicorn/custom-error-definition": "error",
18
+ "unicorn/empty-brace-spaces": "off", // eslint-config-prettier
19
+ "unicorn/error-message": "error",
20
+ "unicorn/escape-case": "error",
21
+ "unicorn/expiring-todo-comments": "error",
22
+ "unicorn/explicit-length-check": "error",
23
+
24
+ /** Disabled since projects may use different file naming conventions. */
25
+ "unicorn/filename-case": "off",
26
+
27
+ "unicorn/import-style": "error",
28
+ "unicorn/new-for-builtins": "error",
29
+
30
+ /** Superseded by the `eslint-comments/no-unlimited-disable` rule. */
31
+ "unicorn/no-abusive-eslint-disable": "off",
32
+
33
+ "unicorn/no-array-callback-reference": "error",
34
+ "unicorn/no-array-for-each": "error",
35
+ "unicorn/no-array-method-this-argument": "error",
36
+ "unicorn/no-array-push-push": "error",
37
+ "unicorn/no-array-reduce": "error",
38
+ "unicorn/no-await-expression-member": "error",
39
+ "unicorn/no-console-spaces": "error",
40
+ "unicorn/no-document-cookie": "error",
41
+ "unicorn/no-empty-file": "error",
42
+ "unicorn/no-for-loop": "error",
43
+ "unicorn/no-hex-escape": "error",
44
+ "unicorn/no-instanceof-array": "error",
45
+ "unicorn/no-invalid-remove-event-listener": "error",
46
+
47
+ /** Disabled because it is common to prefix variables with "new". */
48
+ "unicorn/no-keyword-prefix": "off",
49
+
50
+ "unicorn/no-lonely-if": "error",
51
+ "unicorn/no-negated-condition": "error",
52
+ "unicorn/no-nested-ternary": "off", // eslint-config-prettier
53
+ "unicorn/no-new-array": "error",
54
+ "unicorn/no-new-buffer": "error",
55
+ "unicorn/no-null": "error",
56
+ "unicorn/no-object-as-default-parameter": "error",
57
+
58
+ /**
59
+ * Disabled because using `process.exit` is common to exit command-line applications without
60
+ * verbose output.
61
+ */
62
+ "unicorn/no-process-exit": "off",
63
+
64
+ "unicorn/no-static-only-class": "error",
65
+ "unicorn/no-thenable": "error",
66
+ "unicorn/no-this-assignment": "error",
67
+ "unicorn/no-typeof-undefined": "error",
68
+ "unicorn/no-unnecessary-await": "error",
69
+ "unicorn/no-unreadable-array-destructuring": "error",
70
+ "unicorn/no-unreadable-iife": "error",
71
+ "unicorn/no-unused-properties": "error",
72
+ "unicorn/no-useless-fallback-in-spread": "error",
73
+ "unicorn/no-useless-length-check": "error",
74
+ "unicorn/no-useless-promise-resolve-reject": "error",
75
+ "unicorn/no-useless-spread": "error",
76
+ "unicorn/no-useless-switch-case": "error",
77
+
78
+ /** Disabled since it does not work properly with TypeScript. */
79
+ "unicorn/no-useless-undefined": "off",
80
+
81
+ "unicorn/no-zero-fractions": "error",
82
+ "unicorn/number-literal-case": "off", // eslint-config-prettier
83
+ "unicorn/numeric-separators-style": "error",
84
+ "unicorn/prefer-add-event-listener": "error",
85
+ "unicorn/prefer-array-find": "error",
86
+ "unicorn/prefer-array-flat": "error",
87
+ "unicorn/prefer-array-flat-map": "error",
88
+ "unicorn/prefer-array-index-of": "error",
89
+ "unicorn/prefer-array-some": "error",
90
+ "unicorn/prefer-at": "error",
91
+ "unicorn/prefer-blob-reading-methods": "error",
92
+ "unicorn/prefer-code-point": "error",
93
+ "unicorn/prefer-date-now": "error",
94
+ "unicorn/prefer-default-parameters": "error",
95
+ "unicorn/prefer-dom-node-append": "error",
96
+ "unicorn/prefer-dom-node-dataset": "error",
97
+ "unicorn/prefer-dom-node-remove": "error",
98
+ "unicorn/prefer-dom-node-text-content": "error",
99
+ "unicorn/prefer-event-target": "error",
100
+ "unicorn/prefer-export-from": "error",
101
+ "unicorn/prefer-includes": "error",
102
+
103
+ /** Disabled because the rule is not compatible with TypeScript. */
104
+ "unicorn/prefer-json-parse-buffer": "off",
105
+
106
+ "unicorn/prefer-keyboard-event-key": "error",
107
+ "unicorn/prefer-logical-operator-over-ternary": "error",
108
+ "unicorn/prefer-math-trunc": "error",
109
+ "unicorn/prefer-modern-dom-apis": "error",
110
+ "unicorn/prefer-modern-math-apis": "error",
111
+ "unicorn/prefer-module": "error",
112
+ "unicorn/prefer-native-coercion-functions": "error",
113
+ "unicorn/prefer-negative-index": "error",
114
+ "unicorn/prefer-node-protocol": "error",
115
+ "unicorn/prefer-number-properties": "error",
116
+ "unicorn/prefer-object-from-entries": "error",
117
+ "unicorn/prefer-optional-catch-binding": "error",
118
+ "unicorn/prefer-prototype-methods": "error",
119
+ "unicorn/prefer-query-selector": "error",
120
+ "unicorn/prefer-reflect-apply": "error",
121
+ "unicorn/prefer-regexp-test": "error",
122
+ "unicorn/prefer-set-has": "error",
123
+ "unicorn/prefer-set-size": "error",
124
+ "unicorn/prefer-spread": "error",
125
+ "unicorn/prefer-string-replace-all": "error",
126
+ "unicorn/prefer-string-slice": "error",
127
+ "unicorn/prefer-string-starts-ends-with": "error",
128
+ "unicorn/prefer-string-trim-start-end": "error",
129
+ "unicorn/prefer-switch": "error",
130
+ "unicorn/prefer-ternary": "error",
131
+ "unicorn/prefer-top-level-await": "error",
132
+ "unicorn/prefer-type-error": "error",
133
+
134
+ /** Disabled since it is common to use the variable name of "i". */
135
+ "unicorn/prevent-abbreviations": "off",
136
+
137
+ "unicorn/relative-url-style": "error",
138
+ "unicorn/require-array-join-separator": "error",
139
+ "unicorn/require-number-to-fixed-digits-argument": "error",
140
+
141
+ /** Disabled since it is not recommended by the plugin authors. */
142
+ "unicorn/require-post-message-target-origin": "off",
143
+
144
+ /** Disabled since string content enforcement is too project-specific. */
145
+ "unicorn/string-content": "off",
146
+
147
+ "unicorn/switch-case-braces": "error",
148
+ "unicorn/template-indent": "error",
149
+ "unicorn/text-encoding-identifier-case": "error",
150
+ "unicorn/throw-new-error": "error",
151
+ };
152
+
153
+ /** @type {import("eslint").Linter.RulesRecord} */
154
+ const DEPRECATED_RULES = {
155
+ /** Disabled because this rule is deprecated. */
156
+ "unicorn/import-index": "off",
157
+
158
+ /** Disabled because this rule is deprecated. */
159
+ "unicorn/no-array-instanceof": "off",
160
+
161
+ /** Disabled because this rule is deprecated. */
162
+ "unicorn/no-fn-reference-in-iterator": "off",
163
+
164
+ /** Disabled because this rule is deprecated. */
165
+ "unicorn/no-reduce": "off",
166
+
167
+ /** Disabled because this rule is deprecated. */
168
+ "unicorn/no-unsafe-regex": "off",
169
+
170
+ /** Disabled because this rule is deprecated. */
171
+ "unicorn/prefer-dataset": "off",
172
+
173
+ /** Disabled because this rule is deprecated. */
174
+ "unicorn/prefer-event-key": "off",
175
+
176
+ /** Disabled because this rule is deprecated. */
177
+ "unicorn/prefer-exponentiation-operator": "off",
178
+
179
+ /** Disabled because this rule is deprecated. */
180
+ "unicorn/prefer-flat-map": "off",
181
+
182
+ /** Disabled because this rule is deprecated. */
183
+ "unicorn/prefer-node-append": "off",
184
+
185
+ /** Disabled because this rule is deprecated. */
186
+ "unicorn/prefer-node-remove": "off",
187
+
188
+ /** Disabled because this rule is deprecated. */
189
+ "unicorn/prefer-object-has-own": "off",
190
+
191
+ /** Disabled because this rule is deprecated. */
192
+ "unicorn/prefer-replace-all": "off",
193
+
194
+ /** Disabled because this rule is deprecated. */
195
+ "unicorn/prefer-starts-ends-with": "off",
196
+
197
+ /** Disabled because this rule is deprecated. */
198
+ "unicorn/prefer-text-content": "off",
199
+
200
+ /** Disabled because this rule is deprecated. */
201
+ "unicorn/prefer-trim-start-end": "off",
202
+
203
+ /** Disabled because this rule is deprecated. */
204
+ "unicorn/regex-shorthand": "off",
205
+ };
206
+
207
+ /** @type {import("eslint").Linter.Config} */
208
+ const config = {
209
+ plugins: ["unicorn"],
210
+
211
+ rules: {
212
+ ...NORMAL_RULES,
213
+ ...DEPRECATED_RULES,
214
+ },
215
+
216
+ overrides: [
217
+ // Disable some TypeScript-specific rules in JavaScript files.
218
+ {
219
+ files: ["*.js", "*.cjs", "*.mjs", "*.jsx"],
220
+ rules: {
221
+ "unicorn/prefer-module": "off",
222
+ },
223
+ },
224
+ ],
225
+ };
226
+
227
+ module.exports = config;
package/base.js CHANGED
@@ -1,36 +1,15 @@
1
- // This is a shared configuration file for ESLint:
2
- // https://eslint.org/docs/latest/user-guide/configuring
3
- // This config is meant to be used as a base for all TypeScript projects.
4
- module.exports = {
1
+ /**
2
+ * This ESLint config is meant to be used as a base for all TypeScript projects.
3
+ *
4
+ * @type {import("eslint").Linter.Config}
5
+ */
6
+ const config = {
5
7
  extends: [
6
8
  /**
7
- * The linter base is the Airbnb style guide, which is the most popular JavaScript style guide
8
- * in the world:
9
- * https://github.com/airbnb/javascript
10
- *
11
- * The actual ESLint config is located here:
12
- * https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules
13
- */
14
- "airbnb-base",
15
-
16
- /**
17
- * The TypeScript config extends it:
18
- * https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js
19
- * (This includes the "parser" declaration of "@typescript-eslint/parser".)
20
- */
21
- "airbnb-typescript/base",
22
-
23
- /**
24
- * We extend the Airbnb rules with the "recommended", "recommended-requiring-type-checking", and
25
- * "strict" rules from the "typescript-eslint" plugin, which is also recommended by Matt
26
- * Turnbull, the author of "airbnb-typescript/base":
27
- * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended.ts
28
- * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/recommended-requiring-type-checking.ts
29
- * https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/src/configs/strict.ts
9
+ * Find deprecated code:
10
+ * https://github.com/gund/eslint-plugin-deprecation
30
11
  */
31
- "plugin:@typescript-eslint/recommended",
32
- "plugin:@typescript-eslint/recommended-requiring-type-checking",
33
- "plugin:@typescript-eslint/strict",
12
+ "plugin:deprecation/recommended",
34
13
 
35
14
  /**
36
15
  * This provides extra miscellaneous rules to keep code safe:
@@ -38,48 +17,30 @@ module.exports = {
38
17
  */
39
18
  "plugin:isaacscript/recommended",
40
19
 
41
- /**
42
- * Find unused "eslint-disable" comments:
43
- * https://github.com/mysticatea/eslint-plugin-eslint-comments
44
- */
45
- "plugin:eslint-comments/recommended",
46
-
47
- /**
48
- * Lint Node-specific things:
49
- * https://github.com/eslint-community/eslint-plugin-n
50
- */
51
- "plugin:n/recommended",
52
-
53
20
  /**
54
21
  * Disable any ESLint rules that conflict with Prettier:
55
22
  * https://github.com/prettier/eslint-config-prettier
56
- * (Otherwise, we will have unfixable ESLint errors.)
23
+ * Otherwise, we will have unfixable ESLint errors. Note that the Prettier config has to be
24
+ * before the base ESLint config below since we customize some special rules as documented here:
25
+ * https://github.com/prettier/eslint-config-prettier#special-rules
57
26
  */
58
27
  "prettier",
59
28
 
60
- /** Rule modifications are split out into different files for better organization. */
29
+ /**
30
+ * Rule modifications are split out into different files for better organization (based on the
31
+ * originating plugin) .
32
+ */
61
33
  "./base-eslint",
34
+ "./base-no-autofix",
62
35
  "./base-typescript-eslint",
36
+ "./base-eslint-comments",
37
+ "./base-import",
63
38
  "./base-jsdoc",
39
+ "./base-n", // "n" stands for Node.
40
+ "./base-unicorn",
64
41
  ],
65
42
 
66
43
  plugins: [
67
- /** Activate the "deprecation" plugin, which helps to find deprecated code. */
68
- "deprecation",
69
-
70
- /**
71
- * Activate the "no-autofix" plugin, which allows the fixer for specific rules to be turned off:
72
- * https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix
73
- */
74
- "no-autofix",
75
-
76
- /**
77
- * Activate the "no-type-assertion" plugin, which allows the "no-type-assertion" rule to be
78
- * optionally enabled on a per-project basis:
79
- * https://github.com/Dremora/eslint-plugin-no-type-assertion
80
- */
81
- "no-type-assertion",
82
-
83
44
  /**
84
45
  * Activate the "eslint-plugin-only-warn" plugin to change all errors to warnings:
85
46
  * https://github.com/bfanger/eslint-plugin-only-warn
@@ -88,280 +49,8 @@ module.exports = {
88
49
  * compiler (which show up in red) and ESLint rule violations (which show up in yellow).
89
50
  */
90
51
  "only-warn",
91
-
92
- /**
93
- * Activate the "sort-exports" plugin, which allows the "sort-exports" rule to be optionally
94
- * enabled on a per-project basis:
95
- * https://github.com/jrdrg/eslint-plugin-sort-exports
96
- */
97
- "sort-exports",
98
-
99
- /**
100
- * Activate the "unicorn" plugin, which allows for various miscellaneous useful rules:
101
- * https://github.com/sindresorhus/eslint-plugin-unicorn
102
- */
103
- "unicorn",
104
52
  ],
105
53
 
106
- rules: {
107
- /**
108
- * Documentation:
109
- * https://github.com/gund/eslint-plugin-deprecation
110
- *
111
- * Not defined in parent configs.
112
- *
113
- * Warn on deprecated code.
114
- */
115
- "deprecation/deprecation": "warn",
116
-
117
- /**
118
- * Documentation:
119
- * https://github.com/mysticatea/eslint-plugin-eslint-comments/blob/master/docs/rules/disable-enable-pair.md
120
- *
121
- * Defined at:
122
- * https://github.com/mysticatea/eslint-plugin-eslint-comments/blob/master/lib/configs/recommended.js
123
- *
124
- * By default, it does not allow "eslint-disable" comments for a whole file, which is standard
125
- * practice.
126
- */
127
- "eslint-comments/disable-enable-pair": [
128
- "warn",
129
- {
130
- allowWholeFile: true,
131
- },
132
- ],
133
-
134
- /**
135
- * Documentation:
136
- * https://github.com/mysticatea/eslint-plugin-eslint-comments/blob/master/docs/rules/no-unlimited-disable.md
137
- *
138
- * Defined at:
139
- * https://github.com/mysticatea/eslint-plugin-eslint-comments/blob/master/lib/configs/recommended.js
140
- *
141
- * If a line breaks two or more ESLint rules, then it is useful to use a single "eslint-disable"
142
- * comment.
143
- */
144
- "eslint-comments/no-unlimited-disable": "off",
145
-
146
- /**
147
- * Documentation:
148
- * https://github.com/mysticatea/eslint-plugin-eslint-comments/blob/master/docs/rules/no-unused-disable.md
149
- *
150
- * Not defined in the parent configs.
151
- *
152
- * This can help clean up unnecessary comments.
153
- */
154
- "eslint-comments/no-unused-disable": "warn",
155
-
156
- /**
157
- * Documentation:
158
- * https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/extensions.md
159
- *
160
- * Defined at:
161
- * https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/imports.js
162
- * https://github.com/iamturns/eslint-config-airbnb-typescript/blob/master/lib/shared.js
163
- *
164
- * This rule is useful in commonjs codebases that want to ban file extensions on imports.
165
- * However, ESM is now the standard and file extensions should be used. Furthermore, in
166
- * TypeScript codebases, the compiler will alert us to any errors on a file extension in an
167
- * import statement.
168
- */
169
- "import/extensions": "off",
170
-
171
- /**
172
- * Documentation:
173
- * https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-default-export.md
174
- *
175
- * Not defined in the parent configs.
176
- *
177
- * The case against default exports is layed out here:
178
- * https://basarat.gitbook.io/typescript/main-1/defaultisbad
179
- */
180
- "import/no-default-export": "warn",
181
-
182
- /**
183
- * Documentation:
184
- * https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-unresolved.md
185
- *
186
- * Defined at:
187
- * https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/imports.js
188
- *
189
- * This rule is not necessary in TypeScript codebases, since the compiler would error if you had
190
- * a typo in an import statement.
191
- */
192
- "import/no-unresolved": "off",
193
-
194
- /**
195
- * Documentation:
196
- * https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/prefer-default-export.md
197
- *
198
- * Defined at:
199
- * https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/imports.js
200
- *
201
- * The case against default exports is layed out here:
202
- * https://basarat.gitbook.io/typescript/main-1/defaultisbad
203
- */
204
- "import/prefer-default-export": "off",
205
-
206
- /**
207
- * Documentation:
208
- * https://github.com/mysticatea/eslint-plugin-node/blob/master/docs/rules/file-extension-in-import.md
209
- *
210
- * Not defined in parent configs.
211
- *
212
- * We use this to automatically fix import statements to ESM.
213
- */
214
- "n/file-extension-in-import": ["warn", "always"],
215
-
216
- /**
217
- * Documentation:
218
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-import.md
219
- *
220
- * Defined at:
221
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/configs/_commons.js
222
- *
223
- * The TypeScript compiler will warn us if an import does not exist, so this rule is
224
- * unnecessary.
225
- */
226
- "n/no-extraneous-import": "off",
227
-
228
- /**
229
- * Documentation:
230
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-extraneous-require.md
231
- *
232
- * Defined at:
233
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/configs/_commons.js
234
- *
235
- * Require statements are not used in TypeScript code.
236
- */
237
- "n/no-extraneous-require": "off",
238
-
239
- /**
240
- * Documentation:
241
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-missing-import.md
242
- *
243
- * Defined at:
244
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/configs/_commons.js
245
- *
246
- * The TypeScript compiler will warn us if an import does not exist, so this rule is
247
- * unnecessary.
248
- */
249
- "n/no-missing-import": "off",
250
-
251
- /**
252
- * Documentation:
253
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-process-exit.md
254
- *
255
- * Defined at:
256
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/configs/_commons.js
257
- *
258
- * Using "process.exit" allows the ability to exit command-line applications without verbose
259
- * output.
260
- */
261
- "n/no-process-exit": "off",
262
-
263
- /**
264
- * Documentation:
265
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-syntax.md
266
- *
267
- * Defined at:
268
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/configs/_commons.js
269
- *
270
- * This rule requires adding `parserOptions.ecmaVersion` to every ESLint configuration file. The
271
- * rule does not provide enough value to make that modification worth it.
272
- */
273
- "n/no-unsupported-features/es-syntax": "off",
274
-
275
- /**
276
- * Documentation:
277
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/es-syntax.md
278
- *
279
- * Defined at:
280
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/configs/_commons.js
281
- *
282
- * This rule requires adding `parserOptions.ecmaVersion` to every ESLint configuration file. The
283
- * rule does not provide enough value to make that modification worth it.
284
- */
285
- "n/no-unsupported-features/es-builtins": "off",
286
-
287
- /**
288
- * Documentation:
289
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/no-unsupported-features/node-builtins.md
290
- *
291
- * Defined at:
292
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/configs/_commons.js
293
- *
294
- * The TypeScript compiler will prevent us from using Node modules that are not present in the
295
- * corresponding specified Node output environment, so this rule is unnecessary.
296
- */
297
- "n/no-unsupported-features/node-builtins": "off",
298
-
299
- /**
300
- * Documentation:
301
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/docs/rules/shebang.md
302
- *
303
- * Defined at:
304
- * https://github.com/eslint-community/eslint-plugin-n/blob/master/lib/configs/_commons.js
305
- *
306
- * We need to configure this rule to be Typescript-aware.
307
- */
308
- "n/shebang": [
309
- "warn",
310
- {
311
- convertPath: {
312
- "src/**/*.ts": ["^src/(.+?)\\.ts$", "dist/$1.js"],
313
- },
314
- },
315
- ],
316
-
317
- /**
318
- * Documentation:
319
- * https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix
320
- *
321
- * We want to disable the autofix for this rule, since it is almost always unwanted.
322
- */
323
- "no-useless-return": "off",
324
- "no-autofix/no-useless-return": "warn",
325
-
326
- /**
327
- * Documentation:
328
- * https://github.com/aladdin-add/eslint-plugin/tree/master/packages/no-autofix
329
- *
330
- * We want to disable the autofix for this rule, since it is almost always unwanted.
331
- */
332
- "prefer-const": "off",
333
- "no-autofix/prefer-const": "warn",
334
-
335
- /**
336
- * Documentation:
337
- * https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-node-protocol.md
338
- *
339
- * Not defined in parent configs.
340
- *
341
- * Enforce the new "node:" prefix as an extra safety measure.
342
- */
343
- "unicorn/prefer-node-protocol": "warn",
344
-
345
- /**
346
- * Documentation:
347
- * https://eslint.org/docs/latest/rules/no-restricted-syntax
348
- *
349
- * Not defined in parent configs.
350
- *
351
- * Prevent superfluous type annotations, which can cause bugs with widened types.
352
- */
353
- // https://github.com/typescript-eslint/typescript-eslint/issues/6446
354
- "no-restricted-syntax": [
355
- "warn",
356
- {
357
- selector:
358
- 'VariableDeclarator[id.typeAnnotation] > :matches(TSTypeAssertion, TSAsExpression) > TSTypeReference.typeAnnotation > Identifier[name="const"]',
359
- message:
360
- "Don't use `as const` with a type annotated variable, since it widens the type.",
361
- },
362
- ],
363
- },
364
-
365
54
  overrides: [
366
55
  // Disable some TypeScript-specific rules in JavaScript files.
367
56
  {
@@ -372,13 +61,7 @@ module.exports = {
372
61
  "isaacscript/require-capital-read-only": "off",
373
62
  },
374
63
  },
375
-
376
- // Remark configs require a default export.
377
- {
378
- files: [".remarkrc.mjs"],
379
- rules: {
380
- "import/no-default-export": "off",
381
- },
382
- },
383
64
  ],
384
65
  };
66
+
67
+ module.exports = config;