@rhyster/eslint-config 1.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 (44) hide show
  1. package/LICENSE +20 -0
  2. package/README.md +7 -0
  3. package/dist/build.config.d.ts +3 -0
  4. package/dist/build.config.d.ts.map +1 -0
  5. package/dist/eslint.config.d.ts +853 -0
  6. package/dist/eslint.config.d.ts.map +1 -0
  7. package/dist/index.cjs +1911 -0
  8. package/dist/index.cjs.map +1 -0
  9. package/dist/index.d.cts +3731 -0
  10. package/dist/index.d.mts +3731 -0
  11. package/dist/index.d.ts +3731 -0
  12. package/dist/index.mjs +1898 -0
  13. package/dist/index.mjs.map +1 -0
  14. package/dist/src/airbnb/best-practices.d.ts +177 -0
  15. package/dist/src/airbnb/best-practices.d.ts.map +1 -0
  16. package/dist/src/airbnb/errors.d.ts +69 -0
  17. package/dist/src/airbnb/errors.d.ts.map +1 -0
  18. package/dist/src/airbnb/es6.d.ts +82 -0
  19. package/dist/src/airbnb/es6.d.ts.map +1 -0
  20. package/dist/src/airbnb/imports.d.ts +91 -0
  21. package/dist/src/airbnb/imports.d.ts.map +1 -0
  22. package/dist/src/airbnb/node.d.ts +19 -0
  23. package/dist/src/airbnb/node.d.ts.map +1 -0
  24. package/dist/src/airbnb/strict.d.ts +8 -0
  25. package/dist/src/airbnb/strict.d.ts.map +1 -0
  26. package/dist/src/airbnb/style.d.ts +310 -0
  27. package/dist/src/airbnb/style.d.ts.map +1 -0
  28. package/dist/src/airbnb/variables.d.ts +35 -0
  29. package/dist/src/airbnb/variables.d.ts.map +1 -0
  30. package/dist/src/index.d.ts +3729 -0
  31. package/dist/src/index.d.ts.map +1 -0
  32. package/dist/src/typescript.d.ts +49 -0
  33. package/dist/src/typescript.d.ts.map +1 -0
  34. package/package.json +59 -0
  35. package/src/airbnb/best-practices.ts +477 -0
  36. package/src/airbnb/errors.ts +215 -0
  37. package/src/airbnb/es6.ts +210 -0
  38. package/src/airbnb/imports.ts +288 -0
  39. package/src/airbnb/node.ts +54 -0
  40. package/src/airbnb/strict.ts +9 -0
  41. package/src/airbnb/style.ts +699 -0
  42. package/src/airbnb/variables.ts +74 -0
  43. package/src/index.ts +111 -0
  44. package/src/typescript.ts +90 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAErC,KAAK,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAC5B,KAAK,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AACrD,KAAK,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC;AAsD/D,eAAO,MAAM,IAAI;;;;;;uCAjDgC,MAAM;+BACpB,MAAM;6BACC,MAAM;;;yBAGb,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgFZ,CAAC"}
@@ -0,0 +1,49 @@
1
+ declare const _default: {
2
+ name: string;
3
+ rules: {
4
+ '@typescript-eslint/naming-convention': "error";
5
+ camelcase: "off";
6
+ '@typescript-eslint/default-param-last': "error";
7
+ 'default-param-last': "off";
8
+ '@typescript-eslint/dot-notation': "error";
9
+ 'dot-notation': "off";
10
+ '@typescript-eslint/no-array-constructor': "error";
11
+ 'no-array-constructor': "off";
12
+ '@typescript-eslint/no-empty-function': "error";
13
+ 'no-empty-function': "off";
14
+ '@typescript-eslint/no-implied-eval': "error";
15
+ 'no-implied-eval': "off";
16
+ 'no-new-func': "off";
17
+ '@typescript-eslint/no-loop-func': "error";
18
+ 'no-loop-func': "off";
19
+ '@typescript-eslint/no-magic-numbers': "off";
20
+ 'no-magic-numbers': "off";
21
+ '@typescript-eslint/no-shadow': "error";
22
+ 'no-shadow': "off";
23
+ '@typescript-eslint/only-throw-error': "error";
24
+ 'no-throw-literal': "off";
25
+ '@typescript-eslint/no-unused-expressions': "error";
26
+ 'no-unused-expressions': "off";
27
+ '@typescript-eslint/no-unused-vars': "error";
28
+ 'no-unused-vars': "off";
29
+ '@typescript-eslint/no-use-before-define': "error";
30
+ 'no-use-before-define': "off";
31
+ '@typescript-eslint/no-useless-constructor': "error";
32
+ 'no-useless-constructor': "off";
33
+ '@typescript-eslint/prefer-promise-reject-errors': "error";
34
+ 'prefer-promise-reject-errors': "off";
35
+ '@typescript-eslint/require-await': "off";
36
+ 'require-await': "off";
37
+ '@typescript-eslint/return-await': ["error", string];
38
+ 'no-return-await': "off";
39
+ 'no-dupe-class-members': "off";
40
+ 'no-redeclare': "off";
41
+ 'import-x/named': "off";
42
+ 'import-x/namespace': "off";
43
+ 'import-x/default': "off";
44
+ 'import-x/no-named-as-default-member': "off";
45
+ 'import-x/no-unresolved': "off";
46
+ };
47
+ };
48
+ export default _default;
49
+ //# sourceMappingURL=typescript.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"typescript.d.ts","sourceRoot":"","sources":["../../src/typescript.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,wBAuF0B"}
package/package.json ADDED
@@ -0,0 +1,59 @@
1
+ {
2
+ "name": "@rhyster/eslint-config",
3
+ "version": "1.0.0",
4
+ "description": "ESLint config",
5
+ "type": "module",
6
+ "exports": {
7
+ ".": {
8
+ "types": "./dist/src/index.d.ts",
9
+ "import": "./dist/index.mjs",
10
+ "require": "./dist/index.cjs"
11
+ }
12
+ },
13
+ "main": "./dist/index.cjs",
14
+ "module": "./dist/index.mjs",
15
+ "types": "./dist/src/index.d.ts",
16
+ "files": [
17
+ "dist",
18
+ "src"
19
+ ],
20
+ "scripts": {
21
+ "build": "unbuild && tsc --project .",
22
+ "lint": "eslint . --flag unstable_ts_config"
23
+ },
24
+ "homepage": "https://github.com/LiangYuxuan/eslint-config#readme",
25
+ "repository": {
26
+ "type": "git",
27
+ "url": "https://github.com/LiangYuxuan/eslint-config.git"
28
+ },
29
+ "keywords": [
30
+ "eslint",
31
+ "eslintconfig",
32
+ "config",
33
+ "typescript"
34
+ ],
35
+ "author": "Rhythm",
36
+ "license": "MIT",
37
+ "devDependencies": {
38
+ "@types/confusing-browser-globals": "^1.0.3",
39
+ "@types/eslint__js": "^8.42.3",
40
+ "eslint": "^9.12.0",
41
+ "jiti": "^2.3.3",
42
+ "typescript": "^5.6.3",
43
+ "unbuild": "^2.0.0"
44
+ },
45
+ "peerDependencies": {
46
+ "eslint": ">= 9"
47
+ },
48
+ "dependencies": {
49
+ "@eslint/js": "^9.13.0",
50
+ "@stylistic/eslint-plugin": "^2.9.0",
51
+ "confusing-browser-globals": "^1.0.11",
52
+ "eslint-import-resolver-typescript": "^3.6.3",
53
+ "eslint-plugin-import-x": "^4.3.1",
54
+ "eslint-plugin-n": "^17.11.1",
55
+ "globals": "^15.11.0",
56
+ "typescript-eslint": "^8.11.0"
57
+ },
58
+ "packageManager": "pnpm@9.12.3+sha512.cce0f9de9c5a7c95bef944169cc5dfe8741abfb145078c0d508b868056848a87c81e626246cb60967cbd7fd29a6c062ef73ff840d96b3c86c40ac92cf4a813ee"
59
+ }
@@ -0,0 +1,477 @@
1
+ import type { Linter } from 'eslint';
2
+
3
+ export default {
4
+ name: '@rhyster/eslint-config/airbnb/best-practices',
5
+ rules: {
6
+ // enforces getter/setter pairs in objects
7
+ // https://eslint.org/docs/rules/accessor-pairs
8
+ 'accessor-pairs': 'off',
9
+
10
+ // enforces return statements in callbacks of array's methods
11
+ // https://eslint.org/docs/rules/array-callback-return
12
+ 'array-callback-return': ['error', { allowImplicit: true }],
13
+
14
+ // treat var statements as if they were block scoped
15
+ // https://eslint.org/docs/rules/block-scoped-var
16
+ 'block-scoped-var': 'error',
17
+
18
+ // specify the maximum cyclomatic complexity allowed in a program
19
+ // https://eslint.org/docs/rules/complexity
20
+ complexity: ['off', 20],
21
+
22
+ // enforce that class methods use "this"
23
+ // https://eslint.org/docs/rules/class-methods-use-this
24
+ 'class-methods-use-this': [
25
+ 'error',
26
+ {
27
+ exceptMethods: [],
28
+ },
29
+ ],
30
+
31
+ // require return statements to either always or never specify values
32
+ // https://eslint.org/docs/rules/consistent-return
33
+ 'consistent-return': 'error',
34
+
35
+ // specify curly brace conventions for all control statements
36
+ // https://eslint.org/docs/rules/curly
37
+ curly: ['error', 'multi-line'], // multiline
38
+
39
+ // require default case in switch statements
40
+ // https://eslint.org/docs/rules/default-case
41
+ 'default-case': ['error', { commentPattern: '^no default$' }],
42
+
43
+ // Enforce default clauses in switch statements to be last
44
+ // https://eslint.org/docs/rules/default-case-last
45
+ 'default-case-last': 'error',
46
+
47
+ // https://eslint.org/docs/rules/default-param-last
48
+ 'default-param-last': 'error',
49
+
50
+ // encourages use of dot notation whenever possible
51
+ // https://eslint.org/docs/rules/dot-notation
52
+ 'dot-notation': ['error', { allowKeywords: true }],
53
+
54
+ // enforces consistent newlines before or after dots
55
+ // https://eslint.style/rules/default/dot-location
56
+ '@stylistic/dot-location': ['error', 'property'],
57
+
58
+ // require the use of === and !==
59
+ // https://eslint.org/docs/rules/eqeqeq
60
+ eqeqeq: [
61
+ 'error',
62
+ 'always',
63
+ { null: 'ignore' },
64
+ ],
65
+
66
+ // Require grouped accessor pairs in object literals and classes
67
+ // https://eslint.org/docs/rules/grouped-accessor-pairs
68
+ 'grouped-accessor-pairs': 'error',
69
+
70
+ // make sure for-in loops have an if statement
71
+ // https://eslint.org/docs/rules/guard-for-in
72
+ 'guard-for-in': 'error',
73
+
74
+ // enforce a maximum number of classes per file
75
+ // https://eslint.org/docs/rules/max-classes-per-file
76
+ 'max-classes-per-file': ['error', 1],
77
+
78
+ // disallow the use of alert, confirm, and prompt
79
+ // https://eslint.org/docs/rules/no-alert
80
+ 'no-alert': 'error',
81
+
82
+ // disallow use of arguments.caller or arguments.callee
83
+ // https://eslint.org/docs/rules/no-caller
84
+ 'no-caller': 'error',
85
+
86
+ // disallow lexical declarations in case/default clauses
87
+ // https://eslint.org/docs/rules/no-case-declarations
88
+ 'no-case-declarations': 'error',
89
+
90
+ // Disallow returning value in constructor
91
+ // https://eslint.org/docs/rules/no-constructor-return
92
+ 'no-constructor-return': 'error',
93
+
94
+ // disallow division operators explicitly at beginning of regular expression
95
+ // https://eslint.org/docs/rules/no-div-regex
96
+ 'no-div-regex': 'off',
97
+
98
+ // disallow else after a return in an if
99
+ // https://eslint.org/docs/rules/no-else-return
100
+ 'no-else-return': ['error', { allowElseIf: false }],
101
+
102
+ // disallow empty functions, except for standalone funcs/arrows
103
+ // https://eslint.org/docs/rules/no-empty-function
104
+ 'no-empty-function': [
105
+ 'error',
106
+ {
107
+ allow: [
108
+ 'arrowFunctions',
109
+ 'functions',
110
+ 'methods',
111
+ ],
112
+ },
113
+ ],
114
+
115
+ // disallow empty destructuring patterns
116
+ // https://eslint.org/docs/rules/no-empty-pattern
117
+ 'no-empty-pattern': 'error',
118
+
119
+ // Disallow empty static blocks
120
+ // https://eslint.org/docs/rules/no-empty-static-block
121
+ 'no-empty-static-block': 'error',
122
+
123
+ // disallow comparisons to null without a type-checking operator
124
+ // https://eslint.org/docs/rules/no-eq-null
125
+ 'no-eq-null': 'off',
126
+
127
+ // disallow use of eval()
128
+ // https://eslint.org/docs/rules/no-eval
129
+ 'no-eval': 'error',
130
+
131
+ // disallow adding to native types
132
+ // https://eslint.org/docs/rules/no-extend-native
133
+ 'no-extend-native': 'error',
134
+
135
+ // disallow unnecessary function binding
136
+ // https://eslint.org/docs/rules/no-extra-bind
137
+ 'no-extra-bind': 'error',
138
+
139
+ // disallow Unnecessary Labels
140
+ // https://eslint.org/docs/rules/no-extra-label
141
+ 'no-extra-label': 'error',
142
+
143
+ // disallow fallthrough of case statements
144
+ // https://eslint.org/docs/rules/no-fallthrough
145
+ 'no-fallthrough': 'error',
146
+
147
+ // disallow the use of leading or trailing decimal points in numeric literals
148
+ // https://eslint.style/rules/default/no-floating-decimal
149
+ '@stylistic/no-floating-decimal': 'error',
150
+
151
+ // disallow reassignments of native objects or read-only globals
152
+ // https://eslint.org/docs/rules/no-global-assign
153
+ 'no-global-assign': ['error', { exceptions: [] }],
154
+
155
+ // disallow implicit type conversions
156
+ // https://eslint.org/docs/rules/no-implicit-coercion
157
+ 'no-implicit-coercion': [
158
+ 'off',
159
+ {
160
+ boolean: false,
161
+ number: true,
162
+ string: true,
163
+ allow: [],
164
+ },
165
+ ],
166
+
167
+ // disallow var and named functions in global scope
168
+ // https://eslint.org/docs/rules/no-implicit-globals
169
+ 'no-implicit-globals': 'off',
170
+
171
+ // disallow use of eval()-like methods
172
+ // https://eslint.org/docs/rules/no-implied-eval
173
+ 'no-implied-eval': 'error',
174
+
175
+ // disallow this keywords outside of classes or class-like objects
176
+ // https://eslint.org/docs/rules/no-invalid-this
177
+ 'no-invalid-this': 'off',
178
+
179
+ // disallow usage of __iterator__ property
180
+ // https://eslint.org/docs/rules/no-iterator
181
+ 'no-iterator': 'error',
182
+
183
+ // disallow use of labels for anything other than loops and switches
184
+ // https://eslint.org/docs/rules/no-labels
185
+ 'no-labels': ['error', { allowLoop: false, allowSwitch: false }],
186
+
187
+ // disallow unnecessary nested blocks
188
+ // https://eslint.org/docs/rules/no-lone-blocks
189
+ 'no-lone-blocks': 'error',
190
+
191
+ // disallow creation of functions within loops
192
+ // https://eslint.org/docs/rules/no-loop-func
193
+ 'no-loop-func': 'error',
194
+
195
+ // disallow magic numbers
196
+ // https://eslint.org/docs/rules/no-magic-numbers
197
+ 'no-magic-numbers': [
198
+ 'off',
199
+ {
200
+ ignore: [],
201
+ ignoreArrayIndexes: true,
202
+ enforceConst: true,
203
+ detectObjects: false,
204
+ },
205
+ ],
206
+
207
+ // disallow use of multiple spaces
208
+ // https://eslint.style/rules/default/no-multi-spaces
209
+ '@stylistic/no-multi-spaces': [
210
+ 'error',
211
+ {
212
+ ignoreEOLComments: false,
213
+ },
214
+ ],
215
+
216
+ // disallow use of multiline strings
217
+ // https://eslint.org/docs/rules/no-multi-str
218
+ 'no-multi-str': 'error',
219
+
220
+ // disallow use of new operator when not part of the assignment or comparison
221
+ // https://eslint.org/docs/rules/no-new
222
+ 'no-new': 'error',
223
+
224
+ // disallow use of new operator for Function object
225
+ // https://eslint.org/docs/rules/no-new-func
226
+ 'no-new-func': 'error',
227
+
228
+ // disallows creating new instances of String, Number, and Boolean
229
+ // https://eslint.org/docs/rules/no-new-wrappers
230
+ 'no-new-wrappers': 'error',
231
+
232
+ // Disallow \8 and \9 escape sequences in string literals
233
+ // https://eslint.org/docs/rules/no-nonoctal-decimal-escape
234
+ 'no-nonoctal-decimal-escape': 'error',
235
+
236
+ // Disallow calls to the Object constructor without an argument
237
+ // https://eslint.org/docs/rules/no-object-constructor
238
+ 'no-object-constructor': 'error',
239
+
240
+ // disallow use of (old style) octal literals
241
+ // https://eslint.org/docs/rules/no-octal
242
+ 'no-octal': 'error',
243
+
244
+ // disallow use of octal escape sequences in string literals, such as
245
+ // var foo = 'Copyright \251';
246
+ // https://eslint.org/docs/rules/no-octal-escape
247
+ 'no-octal-escape': 'error',
248
+
249
+ // disallow reassignment of function parameters
250
+ // disallow parameter object manipulation except for specific exclusions
251
+ // rule: https://eslint.org/docs/rules/no-param-reassign.html
252
+ 'no-param-reassign': [
253
+ 'error',
254
+ {
255
+ props: true,
256
+ ignorePropertyModificationsFor: [
257
+ 'acc', // for reduce accumulators
258
+ 'accumulator', // for reduce accumulators
259
+ 'e', // for e.returnvalue
260
+ 'ctx', // for Koa routing
261
+ 'context', // for Koa routing
262
+ 'req', // for Express requests
263
+ 'request', // for Express requests
264
+ 'res', // for Express responses
265
+ 'response', // for Express responses
266
+ '$scope', // for Angular 1 scopes
267
+ 'staticContext', // for ReactRouter context
268
+ ],
269
+ },
270
+ ],
271
+
272
+ // disallow usage of __proto__ property
273
+ // https://eslint.org/docs/rules/no-proto
274
+ 'no-proto': 'error',
275
+
276
+ // disallow declaring the same variable more than once
277
+ // https://eslint.org/docs/rules/no-redeclare
278
+ 'no-redeclare': 'error',
279
+
280
+ // disallow certain object properties
281
+ // https://eslint.org/docs/rules/no-restricted-properties
282
+ 'no-restricted-properties': [
283
+ 'error',
284
+ {
285
+ object: 'arguments',
286
+ property: 'callee',
287
+ message: 'arguments.callee is deprecated',
288
+ },
289
+ {
290
+ object: 'global',
291
+ property: 'isFinite',
292
+ message: 'Please use Number.isFinite instead',
293
+ },
294
+ {
295
+ object: 'self',
296
+ property: 'isFinite',
297
+ message: 'Please use Number.isFinite instead',
298
+ },
299
+ {
300
+ object: 'window',
301
+ property: 'isFinite',
302
+ message: 'Please use Number.isFinite instead',
303
+ },
304
+ {
305
+ object: 'global',
306
+ property: 'isNaN',
307
+ message: 'Please use Number.isNaN instead',
308
+ },
309
+ {
310
+ object: 'self',
311
+ property: 'isNaN',
312
+ message: 'Please use Number.isNaN instead',
313
+ },
314
+ {
315
+ object: 'window',
316
+ property: 'isNaN',
317
+ message: 'Please use Number.isNaN instead',
318
+ },
319
+ {
320
+ property: '__defineGetter__',
321
+ message: 'Please use Object.defineProperty instead.',
322
+ },
323
+ {
324
+ property: '__defineSetter__',
325
+ message: 'Please use Object.defineProperty instead.',
326
+ },
327
+ {
328
+ object: 'Math',
329
+ property: 'pow',
330
+ message: 'Use the exponentiation operator (**) instead.',
331
+ },
332
+ ],
333
+
334
+ // disallow use of assignment in return statement
335
+ // https://eslint.org/docs/rules/no-return-assign
336
+ 'no-return-assign': ['error', 'always'],
337
+
338
+ // disallow redundant `return await`
339
+ // https://eslint.org/docs/rules/no-return-await
340
+ 'no-return-await': 'error',
341
+
342
+ // disallow use of `javascript:` urls.
343
+ // https://eslint.org/docs/rules/no-script-url
344
+ 'no-script-url': 'error',
345
+
346
+ // disallow self assignment
347
+ // https://eslint.org/docs/rules/no-self-assign
348
+ 'no-self-assign': [
349
+ 'error',
350
+ {
351
+ props: true,
352
+ },
353
+ ],
354
+
355
+ // disallow comparisons where both sides are exactly the same
356
+ // https://eslint.org/docs/rules/no-self-compare
357
+ 'no-self-compare': 'error',
358
+
359
+ // disallow use of comma operator
360
+ // https://eslint.org/docs/rules/no-sequences
361
+ 'no-sequences': 'error',
362
+
363
+ // restrict what can be thrown as an exception
364
+ // https://eslint.org/docs/rules/no-throw-literal
365
+ 'no-throw-literal': 'error',
366
+
367
+ // disallow unmodified conditions of loops
368
+ // https://eslint.org/docs/rules/no-unmodified-loop-condition
369
+ 'no-unmodified-loop-condition': 'off',
370
+
371
+ // disallow usage of expressions in statement position
372
+ // https://eslint.org/docs/rules/no-unused-expressions
373
+ 'no-unused-expressions': [
374
+ 'error',
375
+ {
376
+ allowShortCircuit: false,
377
+ allowTernary: false,
378
+ allowTaggedTemplates: false,
379
+ },
380
+ ],
381
+
382
+ // disallow unused labels
383
+ // https://eslint.org/docs/rules/no-unused-labels
384
+ 'no-unused-labels': 'error',
385
+
386
+ // disallow unnecessary .call() and .apply()
387
+ // https://eslint.org/docs/rules/no-useless-call
388
+ 'no-useless-call': 'off',
389
+
390
+ // Disallow unnecessary catch clauses
391
+ // https://eslint.org/docs/rules/no-useless-catch
392
+ 'no-useless-catch': 'error',
393
+
394
+ // disallow useless string concatenation
395
+ // https://eslint.org/docs/rules/no-useless-concat
396
+ 'no-useless-concat': 'error',
397
+
398
+ // disallow unnecessary string escaping
399
+ // https://eslint.org/docs/rules/no-useless-escape
400
+ 'no-useless-escape': 'error',
401
+
402
+ // disallow redundant return; keywords
403
+ // https://eslint.org/docs/rules/no-useless-return
404
+ 'no-useless-return': 'error',
405
+
406
+ // disallow use of void operator
407
+ // https://eslint.org/docs/rules/no-void
408
+ 'no-void': 'error',
409
+
410
+ // disallow usage of configurable warning terms in comments: e.g. todo
411
+ // https://eslint.org/docs/rules/no-warning-comments
412
+ 'no-warning-comments': [
413
+ 'off',
414
+ {
415
+ terms: [
416
+ 'todo',
417
+ 'fixme',
418
+ 'xxx',
419
+ ],
420
+ location: 'start',
421
+ },
422
+ ],
423
+
424
+ // disallow use of the with statement
425
+ // https://eslint.org/docs/rules/no-with
426
+ 'no-with': 'error',
427
+
428
+ // require using Error objects as Promise rejection reasons
429
+ // https://eslint.org/docs/rules/prefer-promise-reject-errors
430
+ 'prefer-promise-reject-errors': ['error', { allowEmptyReject: true }],
431
+
432
+ // Suggest using named capture group in regular expression
433
+ // https://eslint.org/docs/rules/prefer-named-capture-group
434
+ 'prefer-named-capture-group': 'off',
435
+
436
+ // Prefer Object.hasOwn() over Object.prototype.hasOwnProperty.call()
437
+ // https://eslint.org/docs/rules/prefer-object-has-own
438
+ 'prefer-object-has-own': 'error',
439
+
440
+ // https://eslint.org/docs/rules/prefer-regex-literals
441
+ 'prefer-regex-literals': [
442
+ 'error',
443
+ {
444
+ disallowRedundantWrapping: true,
445
+ },
446
+ ],
447
+
448
+ // require use of the second argument for parseInt()
449
+ // https://eslint.org/docs/rules/radix
450
+ radix: 'error',
451
+
452
+ // require `await` in `async function`
453
+ // (note: this is a horrible rule that should never be used)
454
+ // https://eslint.org/docs/rules/require-await
455
+ 'require-await': 'off',
456
+
457
+ // Enforce the use of u flag on RegExp
458
+ // https://eslint.org/docs/rules/require-unicode-regexp
459
+ 'require-unicode-regexp': 'off',
460
+
461
+ // requires to declare all vars on top of their containing scope
462
+ // https://eslint.org/docs/rules/vars-on-top
463
+ 'vars-on-top': 'error',
464
+
465
+ // require immediate function invocation to be wrapped in parentheses
466
+ // https://eslint.style/rules/default/wrap-iife
467
+ '@stylistic/wrap-iife': [
468
+ 'error',
469
+ 'outside',
470
+ { functionPrototypeMethods: false },
471
+ ],
472
+
473
+ // require or disallow Yoda conditions
474
+ // https://eslint.org/docs/rules/yoda
475
+ yoda: 'error',
476
+ },
477
+ } satisfies Linter.Config;