@enormora/eslint-config-typescript 0.0.8 → 0.0.10

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/base.js CHANGED
@@ -4,7 +4,7 @@ import noSecretsPlugin from 'eslint-plugin-no-secrets';
4
4
  import codeSpellChecker from '@cspell/eslint-plugin';
5
5
  import { stylisticRuleSet } from './rule-sets/stylistic.js';
6
6
  import { bestPracticesRuleSet } from './rule-sets/best-practices.js';
7
- import { ecmaVersion, indentSize, javascriptExtensions } from './constants.js';
7
+ import { ecmaVersion, javascriptExtensions } from './constants.js';
8
8
 
9
9
  export const baseConfig = {
10
10
  languageOptions: {
@@ -43,13 +43,13 @@ export const baseConfig = {
43
43
  ...bestPracticesRuleSet.rules,
44
44
 
45
45
  'array-callback-return': 'error',
46
+ camelcase: 'off',
46
47
  'no-array-constructor': 'error',
47
48
  'no-bitwise': 'error',
48
49
  'no-caller': 'error',
49
50
  'no-case-declarations': 'error',
50
51
  'no-class-assign': 'error',
51
52
  'no-cond-assign': 'error',
52
- 'no-confusing-arrow': 'error',
53
53
  'no-console': 'error',
54
54
  'no-const-assign': 'error',
55
55
  'no-constant-condition': 'error',
@@ -76,10 +76,7 @@ export const baseConfig = {
76
76
  'no-extra-bind': 'error',
77
77
  'no-extra-boolean-cast': 'error',
78
78
  'no-extra-label': 'error',
79
- 'no-extra-parens': 'error',
80
- 'no-extra-semi': 'error',
81
79
  'no-fallthrough': 'error',
82
- 'no-floating-decimal': 'error',
83
80
  'no-func-assign': 'error',
84
81
  'no-implicit-coercion': 'error',
85
82
  'no-implicit-globals': 'error',
@@ -95,21 +92,17 @@ export const baseConfig = {
95
92
  'no-lone-blocks': 'error',
96
93
  'no-lonely-if': 'error',
97
94
  'no-loop-func': 'error',
98
- 'no-mixed-spaces-and-tabs': 'error',
99
95
  'no-new-native-nonconstructor': 'error',
100
- 'linebreak-style': ['error', 'unix'],
101
- 'no-multi-spaces': 'error',
102
96
  'no-multi-str': 'error',
103
- 'no-multiple-empty-lines': ['error', { max: 1 }],
104
97
  'no-global-assign': 'error',
105
98
  'no-negated-condition': 'off',
106
99
  'no-nested-ternary': 'error',
107
100
  'no-new': 'error',
108
101
  'no-new-func': 'error',
109
- 'no-new-object': 'error',
110
102
  'no-new-symbol': 'error',
111
103
  'no-new-wrappers': 'error',
112
104
  'no-obj-calls': 'error',
105
+ 'no-object-constructor': 'error',
113
106
  'no-octal': 'error',
114
107
  'no-octal-escape': 'error',
115
108
  'no-param-reassign': ['error', { props: true }],
@@ -126,9 +119,7 @@ export const baseConfig = {
126
119
  'no-shadow': ['error', { builtinGlobals: true }],
127
120
  'no-shadow-restricted-names': 'error',
128
121
  'no-sparse-arrays': 'error',
129
- 'no-tabs': 'error',
130
122
  'no-ternary': 'off',
131
- 'no-trailing-spaces': 'error',
132
123
  'no-this-before-super': 'error',
133
124
  'no-throw-literal': 'error',
134
125
  'no-undef': ['error', { typeof: true }],
@@ -160,7 +151,6 @@ export const baseConfig = {
160
151
  'no-useless-constructor': 'error',
161
152
  'no-useless-escape': 'error',
162
153
  'no-useless-rename': 'error',
163
- 'no-whitespace-before-property': 'error',
164
154
  'no-void': 'error',
165
155
  'prefer-const': [
166
156
  'error',
@@ -190,19 +180,7 @@ export const baseConfig = {
190
180
  ignore: [-1, 0, 1]
191
181
  }
192
182
  ],
193
- 'no-mixed-operators': 'off',
194
- 'array-bracket-spacing': ['error', 'never'],
195
- 'array-bracket-newline': ['error', 'consistent'],
196
- 'array-element-newline': ['error', 'consistent'],
197
183
  'arrow-body-style': ['error', 'always'],
198
- 'arrow-parens': ['error', 'always'],
199
- 'arrow-spacing': [
200
- 'error',
201
- {
202
- before: true,
203
- after: true
204
- }
205
- ],
206
184
  'accessor-pairs': [
207
185
  'error',
208
186
  {
@@ -210,66 +188,24 @@ export const baseConfig = {
210
188
  }
211
189
  ],
212
190
  'block-scoped-var': 'off',
213
- 'block-spacing': 'off',
214
- 'brace-style': ['error', '1tbs', { allowSingleLine: false }],
215
- camelcase: 'off',
216
- 'comma-dangle': ['error', 'never'],
217
- 'comma-spacing': [
218
- 'error',
219
- {
220
- before: false,
221
- after: true
222
- }
223
- ],
224
- 'comma-style': ['error', 'last'],
225
191
  complexity: ['error', { max: 6 }],
226
- 'computed-property-spacing': [
227
- 'error',
228
- 'never',
229
- {
230
- enforceForClassMembers: true
231
- }
232
- ],
233
192
  'consistent-return': 'error',
234
193
  'consistent-this': ['error', 'self'],
235
194
  'constructor-super': 'error',
236
- 'generator-star-spacing': ['error', { before: false, after: true }],
237
195
  curly: ['error', 'all'],
238
196
  'default-case': 'error',
239
- 'dot-location': ['error', 'property'],
240
197
  'dot-notation': 'error',
241
- 'eol-last': 'error',
242
198
  eqeqeq: 'error',
243
199
  'func-names': 'off',
244
200
  'func-style': 'off',
245
201
  'guard-for-in': 'error',
246
202
  'id-length': ['error', { min: 2, properties: 'never' }],
247
- indent: [
248
- 'error',
249
- indentSize,
250
- {
251
- SwitchCase: 1,
252
- VariableDeclarator: 1,
253
- MemberExpression: 1
254
- }
255
- ],
256
203
  'init-declarations': ['error', 'always'],
257
- 'jsx-quotes': 'off',
258
- 'key-spacing': [
259
- 'error',
260
- {
261
- beforeColon: false,
262
- afterColon: true
263
- }
264
- ],
265
- 'lines-around-comment': 'off',
266
204
  'max-depth': ['error', { max: 5 }],
267
205
  'max-lines': ['error', { max: 500, skipBlankLines: true, skipComments: true }],
268
206
  'max-nested-callbacks': ['error', { max: 4 }],
269
207
  'max-params': ['error', { max: 4 }],
270
208
  'max-statements': ['error', { max: 10 }],
271
- 'multiline-ternary': 'off',
272
- 'max-statements-per-line': ['error', { max: 1 }],
273
209
  'new-cap': [
274
210
  'error',
275
211
  {
@@ -277,23 +213,9 @@ export const baseConfig = {
277
213
  capIsNew: true
278
214
  }
279
215
  ],
280
- 'new-parens': 'error',
281
- 'newline-per-chained-call': 'off',
282
- 'object-curly-newline': 'off',
283
- 'object-curly-spacing': ['error', 'always'],
284
- 'object-property-newline': 'off',
285
216
  'object-shorthand': ['error', 'always'],
286
217
  'one-var': ['error', 'never'],
287
- 'one-var-declaration-per-line': 'error',
288
218
  'operator-assignment': ['error', 'always'],
289
- 'operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before' } }],
290
- 'padded-blocks': [
291
- 'error',
292
- 'never',
293
- {
294
- allowSingleLineBlocks: false
295
- }
296
- ],
297
219
  'prefer-arrow-callback': [
298
220
  'error',
299
221
  {
@@ -301,69 +223,19 @@ export const baseConfig = {
301
223
  }
302
224
  ],
303
225
  'prefer-rest-params': 'error',
304
- 'quote-props': ['error', 'as-needed'],
305
- quotes: ['error', 'single', { avoidEscape: true }],
306
226
  radix: 'error',
307
227
  'id-match': 'off',
308
228
  'require-yield': 'error',
309
- 'rest-spread-spacing': ['error', 'never'],
310
- semi: ['error', 'always'],
311
- 'semi-spacing': [
312
- 'error',
313
- {
314
- before: false,
315
- after: true
316
- }
317
- ],
318
229
  'sort-vars': 'off',
319
- 'keyword-spacing': [
320
- 'error',
321
- {
322
- before: true,
323
- after: true
324
- }
325
- ],
326
- 'space-before-blocks': ['error', 'always'],
327
- 'space-before-function-paren': [
328
- 'error',
329
- {
330
- anonymous: 'always',
331
- named: 'never',
332
- asyncArrow: 'always'
333
- }
334
- ],
335
- 'space-in-parens': ['error', 'never'],
336
- 'space-infix-ops': 'error',
337
- 'space-unary-ops': 'error',
338
- 'spaced-comment': [
339
- 'error',
340
- 'always',
341
- {
342
- line: {
343
- exceptions: ['-', '+', '*'],
344
- markers: ['!', '/', '=>']
345
- },
346
- block: {
347
- exceptions: ['-', '+', '*'],
348
- markers: ['!', '*'],
349
- balanced: true
350
- }
351
- }
352
- ],
353
230
  'sort-imports': 'off',
354
231
  strict: ['error', 'safe'],
355
- 'template-curly-spacing': 'error',
356
232
  'unicode-bom': ['error', 'never'],
357
233
  'use-isnan': 'error',
358
234
  'valid-typeof': 'error',
359
235
  'vars-on-top': 'error',
360
- 'wrap-iife': ['error', 'inside'],
361
- 'wrap-regex': 'off',
362
- 'yield-star-spacing': ['error', { before: false, after: true }],
363
236
  yoda: ['error', 'never'],
364
237
  'capitalized-comments': 'off',
365
238
  'class-methods-use-this': 'error',
366
- 'func-call-spacing': ['error', 'never'],
367
239
  'func-name-matching': 'off',
368
240
  'line-comment-position': 'off',
369
241
  'no-await-in-loop': 'off',
@@ -373,7 +245,6 @@ export const baseConfig = {
373
245
  'no-template-curly-in-string': 'error',
374
246
  'no-unsafe-negation': 'error',
375
247
  'no-useless-return': 'error',
376
- 'nonblock-statement-body-position': 'off',
377
248
  'prefer-destructuring': [
378
249
  'error',
379
250
  {
@@ -400,54 +271,22 @@ export const baseConfig = {
400
271
  'require-await': 'off',
401
272
  'sort-keys': 'off',
402
273
  'symbol-description': 'error',
403
- 'template-tag-spacing': ['error', 'never'],
404
274
  'for-direction': 'off',
405
- 'padding-line-between-statements': [
406
- 'error',
407
- {
408
- blankLine: 'always',
409
- prev: 'directive',
410
- next: '*'
411
- },
412
- {
413
- blankLine: 'any',
414
- prev: 'directive',
415
- next: 'directive'
416
- }
417
- ],
418
- 'semi-style': ['error', 'last'],
419
- 'switch-colon-spacing': [
420
- 'error',
421
- {
422
- after: true,
423
- before: false
424
- }
425
- ],
426
- 'function-paren-newline': 'off',
427
275
  'getter-return': [
428
276
  'error',
429
277
  {
430
278
  allowImplicit: false
431
279
  }
432
280
  ],
433
- 'implicit-arrow-linebreak': 'off',
434
- 'lines-between-class-members': [
435
- 'error',
436
- 'always',
437
- {
438
- exceptAfterSingleLine: true
439
- }
440
- ],
441
281
  'multiline-comment-style': 'off',
442
282
  'max-classes-per-file': 'off',
443
- 'max-lines-per-function': ['error', { max: 75, skipBlankLines: true, skipComments: true }],
283
+ 'max-lines-per-function': 'off',
444
284
  'prefer-object-spread': 'error',
445
285
  'no-async-promise-executor': 'error',
446
286
  'no-misleading-character-class': 'error',
447
287
  'default-param-last': 'error',
448
288
  'prefer-regex-literals': 'error',
449
289
  'require-unicode-regexp': 'off',
450
- 'function-call-argument-newline': ['error', 'consistent'],
451
290
  'no-useless-catch': 'error',
452
291
  'prefer-named-capture-group': 'error',
453
292
  'no-import-assign': 'error',
@@ -458,19 +297,6 @@ export const baseConfig = {
458
297
  'no-alert': 'off',
459
298
  'no-script-url': 'off',
460
299
  'no-restricted-globals': 'off',
461
- 'max-len': [
462
- 'error',
463
- {
464
- code: 120,
465
- tabWidth: indentSize,
466
- ignoreComments: true,
467
- ignoreTrailingComments: true,
468
- ignoreUrls: true,
469
- ignoreStrings: false,
470
- ignoreTemplateLiterals: false,
471
- ignoreRegExpLiterals: true
472
- }
473
- ],
474
300
 
475
301
  'grouped-accessor-pairs': 'off',
476
302
  'no-constructor-return': 'error',
@@ -519,7 +345,7 @@ export const baseConfig = {
519
345
  'import/prefer-default-export': 'off',
520
346
  'import/newline-after-import': 'error',
521
347
  'import/no-nodejs-modules': 'off',
522
- 'import/max-dependencies': ['error', { max: 8 }],
348
+ 'import/max-dependencies': ['error', { max: 10 }],
523
349
  'import/first': 'error',
524
350
  'import/no-unused-modules': 'error',
525
351
  'import/no-anonymous-default-export': 'off',
package/package.json CHANGED
@@ -1,18 +1,19 @@
1
1
  {
2
2
  "dependencies": {
3
- "@cspell/eslint-plugin": "7.3.6",
4
- "@typescript-eslint/eslint-plugin": "6.7.2",
5
- "@typescript-eslint/parser": "6.7.2",
3
+ "@cspell/eslint-plugin": "8.1.3",
4
+ "@stylistic/eslint-plugin": "1.5.1",
5
+ "@typescript-eslint/eslint-plugin": "6.14.0",
6
+ "@typescript-eslint/parser": "6.14.0",
6
7
  "eslint-plugin-array-func": "4.0.0",
7
8
  "eslint-plugin-destructuring": "2.2.1",
8
9
  "eslint-plugin-eslint-comments": "3.2.0",
9
10
  "eslint-plugin-functional": "6.0.0",
10
- "eslint-plugin-import": "2.28.1",
11
+ "eslint-plugin-import": "2.29.0",
11
12
  "eslint-plugin-no-secrets": "0.8.9",
12
- "eslint-plugin-prettier": "5.0.0",
13
+ "eslint-plugin-prettier": "5.0.1",
13
14
  "eslint-plugin-promise": "6.1.1",
14
- "eslint-plugin-sonarjs": "0.21.0",
15
- "eslint-plugin-unicorn": "^48.0.1"
15
+ "eslint-plugin-sonarjs": "0.23.0",
16
+ "eslint-plugin-unicorn": "49.0.0"
16
17
  },
17
18
  "license": "MIT",
18
19
  "main": "typescript.js",
@@ -22,5 +23,5 @@
22
23
  "url": "git://github.com/enormora/eslint-config.git"
23
24
  },
24
25
  "type": "module",
25
- "version": "0.0.8"
26
+ "version": "0.0.10"
26
27
  }
@@ -1,10 +1,13 @@
1
1
  import prettierPlugin from 'eslint-plugin-prettier';
2
2
  import destructuringPlugin from 'eslint-plugin-destructuring';
3
+ import stylisticPlugin from '@stylistic/eslint-plugin';
4
+ import { indentSize } from '../constants.js';
3
5
 
4
6
  export const stylisticRuleSet = {
5
7
  plugins: {
6
8
  prettier: prettierPlugin,
7
- destructuring: destructuringPlugin
9
+ destructuring: destructuringPlugin,
10
+ '@stylistic': stylisticPlugin
8
11
  },
9
12
 
10
13
  settings: {},
@@ -14,6 +17,218 @@ export const stylisticRuleSet = {
14
17
 
15
18
  'destructuring/in-methods-params': 'error',
16
19
  'destructuring/in-params': ['error', { 'max-params': 0 }],
17
- 'destructuring/no-rename': 'off'
20
+ 'destructuring/no-rename': 'off',
21
+
22
+ '@stylistic/array-bracket-newline': ['error', 'consistent'],
23
+ '@stylistic/array-bracket-spacing': ['error', 'never'],
24
+ '@stylistic/array-element-newline': ['error', 'consistent'],
25
+ '@stylistic/arrow-parens': ['error', 'always'],
26
+ '@stylistic/arrow-spacing': [
27
+ 'error',
28
+ {
29
+ before: true,
30
+ after: true
31
+ }
32
+ ],
33
+ '@stylistic/block-spacing': 'off',
34
+ '@stylistic/brace-style': ['error', '1tbs', { allowSingleLine: false }],
35
+ '@stylistic/comma-dangle': ['error', 'never'],
36
+ '@stylistic/comma-spacing': [
37
+ 'error',
38
+ {
39
+ before: false,
40
+ after: true
41
+ }
42
+ ],
43
+ '@stylistic/comma-style': ['error', 'last'],
44
+ '@stylistic/computed-property-spacing': [
45
+ 'error',
46
+ 'never',
47
+ {
48
+ enforceForClassMembers: true
49
+ }
50
+ ],
51
+ '@stylistic/dot-location': ['error', 'property'],
52
+ '@stylistic/eol-last': 'error',
53
+ '@stylistic/func-call-spacing': ['error', 'never'],
54
+ '@stylistic/function-call-spacing': ['error', 'never'],
55
+ '@stylistic/function-call-argument-newline': ['error', 'consistent'],
56
+ '@stylistic/function-paren-newline': 'off',
57
+ '@stylistic/generator-star-spacing': ['error', { before: false, after: true }],
58
+ '@stylistic/indent-binary-ops': ['error', indentSize],
59
+ '@stylistic/implicit-arrow-linebreak': 'off',
60
+ '@stylistic/indent': [
61
+ 'error',
62
+ indentSize,
63
+ {
64
+ SwitchCase: 1,
65
+ VariableDeclarator: 1,
66
+ MemberExpression: 1
67
+ }
68
+ ],
69
+ '@stylistic/jsx-child-element-spacing': 'off',
70
+ '@stylistic/jsx-closing-bracket-location': 'off',
71
+ '@stylistic/jsx-closing-tag-location': 'off',
72
+ '@stylistic/jsx-curly-brace-presence': 'off',
73
+ '@stylistic/jsx-curly-newline': 'off',
74
+ '@stylistic/jsx-curly-spacing': 'off',
75
+ '@stylistic/jsx-equals-spacing': 'off',
76
+ '@stylistic/jsx-first-prop-new-line': 'off',
77
+ '@stylistic/jsx-indent': 'off',
78
+ '@stylistic/jsx-indent-props': 'off',
79
+ '@stylistic/jsx-max-props-per-line': 'off',
80
+ '@stylistic/jsx-newline': 'off',
81
+ '@stylistic/jsx-one-expression-per-line': 'off',
82
+ '@stylistic/jsx-props-no-multi-spaces': 'off',
83
+ '@stylistic/jsx-self-closing-comp': 'off',
84
+ '@stylistic/jsx-sort-props': 'off',
85
+ '@stylistic/jsx-tag-spacing': 'off',
86
+ '@stylistic/jsx-quotes': 'off',
87
+ '@stylistic/jsx-wrap-multilines': 'off',
88
+ '@stylistic/key-spacing': [
89
+ 'error',
90
+ {
91
+ beforeColon: false,
92
+ afterColon: true
93
+ }
94
+ ],
95
+ '@stylistic/keyword-spacing': [
96
+ 'error',
97
+ {
98
+ before: true,
99
+ after: true
100
+ }
101
+ ],
102
+ '@stylistic/linebreak-style': ['error', 'unix'],
103
+ '@stylistic/lines-between-class-members': [
104
+ 'error',
105
+ 'always',
106
+ {
107
+ exceptAfterSingleLine: true
108
+ }
109
+ ],
110
+ '@stylistic/lines-around-comment': 'off',
111
+ '@stylistic/max-len': [
112
+ 'error',
113
+ {
114
+ code: 120,
115
+ tabWidth: indentSize,
116
+ ignoreComments: true,
117
+ ignoreTrailingComments: true,
118
+ ignoreUrls: true,
119
+ ignoreStrings: false,
120
+ ignoreTemplateLiterals: false,
121
+ ignoreRegExpLiterals: true
122
+ }
123
+ ],
124
+ '@stylistic/max-statements-per-line': ['error', { max: 1 }],
125
+ '@stylistic/member-delimiter-style': [
126
+ 'error',
127
+ {
128
+ multiline: {
129
+ delimiter: 'semi',
130
+ requireLast: true
131
+ },
132
+ singleline: {
133
+ delimiter: 'semi',
134
+ requireLast: false
135
+ }
136
+ }
137
+ ],
138
+ '@stylistic/multiline-ternary': 'off',
139
+ '@stylistic/new-parens': 'error',
140
+ '@stylistic/newline-per-chained-call': 'off',
141
+ '@stylistic/no-confusing-arrow': 'error',
142
+ // Currently this rule conflicts with prettier, because in some cases prettier adds unnecessary extra parens. Unfortunately there is no way to turn this off yet. We should re-enable this rule once this has been fixed in prettier or once there is a better formatter that doesn’t add unnecessary parens. See https://github.com/prettier/prettier/issues/3089
143
+ '@stylistic/no-extra-parens': 'off',
144
+ '@stylistic/no-extra-semi': 'error',
145
+ '@stylistic/no-floating-decimal': 'error',
146
+ '@stylistic/no-mixed-operators': 'off',
147
+ '@stylistic/no-mixed-spaces-and-tabs': 'error',
148
+ '@stylistic/no-multi-spaces': 'error',
149
+ '@stylistic/no-multiple-empty-lines': ['error', { max: 1 }],
150
+ '@stylistic/no-tabs': 'error',
151
+ '@stylistic/no-trailing-spaces': 'error',
152
+ '@stylistic/no-whitespace-before-property': 'error',
153
+ '@stylistic/nonblock-statement-body-position': 'off',
154
+ '@stylistic/object-curly-newline': 'off',
155
+ '@stylistic/object-curly-spacing': ['error', 'always'],
156
+ '@stylistic/object-property-newline': 'off',
157
+ '@stylistic/one-var-declaration-per-line': 'error',
158
+ '@stylistic/operator-linebreak': ['error', 'after', { overrides: { '?': 'before', ':': 'before' } }],
159
+ '@stylistic/padded-blocks': [
160
+ 'error',
161
+ 'never',
162
+ {
163
+ allowSingleLineBlocks: false
164
+ }
165
+ ],
166
+ '@stylistic/padding-line-between-statements': [
167
+ 'error',
168
+ {
169
+ blankLine: 'always',
170
+ prev: 'directive',
171
+ next: '*'
172
+ },
173
+ {
174
+ blankLine: 'any',
175
+ prev: 'directive',
176
+ next: 'directive'
177
+ }
178
+ ],
179
+ '@stylistic/quote-props': ['error', 'as-needed'],
180
+ '@stylistic/quotes': ['error', 'single', { avoidEscape: true }],
181
+ '@stylistic/rest-spread-spacing': ['error', 'never'],
182
+ '@stylistic/semi': ['error', 'always'],
183
+ '@stylistic/semi-spacing': [
184
+ 'error',
185
+ {
186
+ before: false,
187
+ after: true
188
+ }
189
+ ],
190
+ '@stylistic/semi-style': ['error', 'last'],
191
+ '@stylistic/space-before-blocks': ['error', 'always'],
192
+ '@stylistic/space-before-function-paren': [
193
+ 'error',
194
+ {
195
+ anonymous: 'always',
196
+ named: 'never',
197
+ asyncArrow: 'always'
198
+ }
199
+ ],
200
+ '@stylistic/space-in-parens': ['error', 'never'],
201
+ '@stylistic/space-infix-ops': 'error',
202
+ '@stylistic/space-unary-ops': 'error',
203
+ '@stylistic/spaced-comment': [
204
+ 'error',
205
+ 'always',
206
+ {
207
+ line: {
208
+ exceptions: ['-', '+', '*'],
209
+ markers: ['!', '/', '=>']
210
+ },
211
+ block: {
212
+ exceptions: ['-', '+', '*'],
213
+ markers: ['!', '*'],
214
+ balanced: true
215
+ }
216
+ }
217
+ ],
218
+ '@stylistic/switch-colon-spacing': [
219
+ 'error',
220
+ {
221
+ after: true,
222
+ before: false
223
+ }
224
+ ],
225
+ '@stylistic/template-curly-spacing': 'error',
226
+ '@stylistic/template-tag-spacing': ['error', 'never'],
227
+ '@stylistic/type-annotation-spacing': 'error',
228
+ '@stylistic/type-generic-spacing': 'error',
229
+ '@stylistic/type-named-tuple-spacing': 'error',
230
+ '@stylistic/wrap-iife': ['error', 'inside'],
231
+ '@stylistic/wrap-regex': 'off',
232
+ '@stylistic/yield-star-spacing': ['error', { before: false, after: true }]
18
233
  }
19
234
  };
package/typescript.js CHANGED
@@ -4,12 +4,22 @@ import functionalPlugin from 'eslint-plugin-functional';
4
4
  import { baseConfig } from './base.js';
5
5
  import { javascriptExtensions, typescriptExtensions } from './constants.js';
6
6
 
7
- function configureWrappedCoreRule(name) {
8
- const coreRuleConfig = baseConfig.rules[name];
7
+ function asArray(value) {
8
+ if (Array.isArray(value)) {
9
+ return value;
10
+ }
11
+
12
+ return [value];
13
+ }
14
+
15
+ function configureWrappedCoreRule(name, optionsOverrides) {
16
+ const coreRuleConfig = asArray(baseConfig.rules[name]);
17
+ const [coreRuleSeverity, ...coreRuleOptions] = coreRuleConfig;
18
+ const options = optionsOverrides === undefined ? coreRuleOptions : asArray(optionsOverrides);
9
19
 
10
20
  return {
11
21
  [name]: 'off',
12
- [`@typescript-eslint/${name}`]: coreRuleConfig
22
+ [`@typescript-eslint/${name}`]: [coreRuleSeverity, ...options]
13
23
  };
14
24
  }
15
25
 
@@ -86,7 +96,6 @@ export const typescriptConfig = {
86
96
  }
87
97
  }
88
98
  ],
89
- ...configureWrappedCoreRule('brace-style'),
90
99
  '@typescript-eslint/naming-convention': [
91
100
  'error',
92
101
  {
@@ -122,21 +131,7 @@ export const typescriptConfig = {
122
131
  allowTypedFunctionExpressions: true
123
132
  }
124
133
  ],
125
- ...configureWrappedCoreRule('func-call-spacing'),
126
- ...configureWrappedCoreRule('indent'),
127
- '@typescript-eslint/member-delimiter-style': [
128
- 'error',
129
- {
130
- multiline: {
131
- delimiter: 'semi',
132
- requireLast: true
133
- },
134
- singleline: {
135
- delimiter: 'semi',
136
- requireLast: false
137
- }
138
- }
139
- ],
134
+ ...configureWrappedCoreRule('max-params'),
140
135
  '@typescript-eslint/member-ordering': 'error',
141
136
  ...configureWrappedCoreRule('no-array-constructor'),
142
137
  ...configureWrappedCoreRule('no-empty-function'),
@@ -166,6 +161,7 @@ export const typescriptConfig = {
166
161
  allowDestructuring: true
167
162
  }
168
163
  ],
164
+ '@typescript-eslint/no-unsafe-unary-minus': 'error',
169
165
  '@typescript-eslint/no-unnecessary-qualifier': 'error',
170
166
  '@typescript-eslint/no-unnecessary-type-arguments': 'error',
171
167
  '@typescript-eslint/no-unnecessary-type-assertion': 'error',
@@ -173,6 +169,7 @@ export const typescriptConfig = {
173
169
  ...configureWrappedCoreRule('no-useless-constructor'),
174
170
  '@typescript-eslint/no-useless-constructor': 'error',
175
171
  '@typescript-eslint/no-var-requires': 'error',
172
+ ...configureWrappedCoreRule('prefer-destructuring'),
176
173
  '@typescript-eslint/prefer-for-of': 'error',
177
174
  '@typescript-eslint/prefer-function-type': 'error',
178
175
  '@typescript-eslint/prefer-includes': 'error',
@@ -185,20 +182,16 @@ export const typescriptConfig = {
185
182
  allowAny: true
186
183
  }
187
184
  ],
188
- ...configureWrappedCoreRule('quotes'),
189
185
  '@typescript-eslint/restrict-plus-operands': 'error',
190
186
  '@typescript-eslint/require-array-sort-compare': 'error',
191
- ...configureWrappedCoreRule('semi'),
192
187
  '@typescript-eslint/triple-slash-reference': [
193
188
  'error',
194
189
  {
195
190
  path: 'never'
196
191
  }
197
192
  ],
198
- '@typescript-eslint/type-annotation-spacing': 'error',
199
193
  '@typescript-eslint/prefer-regexp-exec': 'error',
200
194
  '@typescript-eslint/unified-signatures': 'error',
201
- ...configureWrappedCoreRule('no-unused-expressions'),
202
195
  '@typescript-eslint/require-await': 'off',
203
196
  '@typescript-eslint/strict-boolean-expressions': [
204
197
  'error',
@@ -220,25 +213,33 @@ export const typescriptConfig = {
220
213
  '@typescript-eslint/prefer-nullish-coalescing': 'error',
221
214
  '@typescript-eslint/ban-ts-comment': 'off',
222
215
  '@typescript-eslint/class-literal-property-style': ['error', 'fields'],
223
- ...configureWrappedCoreRule('comma-spacing'),
224
216
  '@typescript-eslint/consistent-type-definitions': ['error', 'type'],
225
217
  ...configureWrappedCoreRule('default-param-last'),
226
218
  ...configureWrappedCoreRule('dot-notation'),
227
219
  '@typescript-eslint/explicit-member-accessibility': 'off',
228
220
  '@typescript-eslint/explicit-module-boundary-types': 'off',
229
221
  '@typescript-eslint/init-declarations': 'off',
230
- ...configureWrappedCoreRule('keyword-spacing'),
231
222
  '@typescript-eslint/method-signature-style': ['error', 'method'],
232
223
  '@typescript-eslint/no-base-to-string': 'error',
233
224
  ...configureWrappedCoreRule('no-dupe-class-members'),
234
225
  '@typescript-eslint/no-dynamic-delete': ['error'],
235
226
  '@typescript-eslint/no-extra-non-null-assertion': ['error'],
236
- ...configureWrappedCoreRule('no-extra-parens'),
237
227
  '@typescript-eslint/no-floating-promises': ['error'],
238
228
  '@typescript-eslint/no-implied-eval': ['error'],
239
229
  '@typescript-eslint/no-invalid-this': ['error'],
240
230
  '@typescript-eslint/no-invalid-void-type': ['error'],
241
- ...configureWrappedCoreRule('no-magic-numbers'),
231
+ ...configureWrappedCoreRule('no-magic-numbers', {
232
+ ignoreEnums: false,
233
+ ignoreNumericLiteralTypes: true,
234
+ ignoreReadonlyClassProperties: false,
235
+ ignoreTypeIndexes: false,
236
+ ignoreDefaultValues: true,
237
+ ignoreArrayIndexes: false,
238
+ detectObjects: false,
239
+ enforceConst: false,
240
+ ignoreClassFieldInitialValues: false,
241
+ ignore: [-1, 0, 1]
242
+ }),
242
243
  '@typescript-eslint/no-namespace': ['error'],
243
244
  '@typescript-eslint/no-non-null-asserted-optional-chain': ['error'],
244
245
  '@typescript-eslint/no-non-null-assertion': ['error'],
@@ -260,7 +261,6 @@ export const typescriptConfig = {
260
261
  '@typescript-eslint/switch-exhaustiveness-check': ['error'],
261
262
  '@typescript-eslint/typedef': ['off'],
262
263
  '@typescript-eslint/unbound-method': ['off'],
263
- ...configureWrappedCoreRule('lines-between-class-members'),
264
264
  '@typescript-eslint/ban-tslint-comment': ['off'],
265
265
  '@typescript-eslint/no-confusing-non-null-assertion': ['error'],
266
266
  '@typescript-eslint/prefer-enum-initializers': ['off'],
@@ -272,7 +272,6 @@ export const typescriptConfig = {
272
272
  'error',
273
273
  { prefer: 'type-imports', fixStyle: 'inline-type-imports', disallowTypeAnnotations: true }
274
274
  ],
275
- ...configureWrappedCoreRule('comma-dangle'),
276
275
  '@typescript-eslint/consistent-indexed-object-style': ['error', 'record'],
277
276
  '@typescript-eslint/no-loop-func': 'off',
278
277
  '@typescript-eslint/space-infix-ops': 'off',
@@ -285,7 +284,6 @@ export const typescriptConfig = {
285
284
  }
286
285
  ],
287
286
  '@typescript-eslint/non-nullable-type-assertion-style': 'off',
288
- '@typescript-eslint/object-curly-spacing': 'off',
289
287
  '@typescript-eslint/sort-type-constituents': [
290
288
  'error',
291
289
  {
@@ -325,7 +323,6 @@ export const typescriptConfig = {
325
323
  '@typescript-eslint/no-import-type-side-effects': 'error',
326
324
  '@typescript-eslint/no-duplicate-type-constituents': 'error',
327
325
  '@typescript-eslint/lines-around-comment': 'off',
328
- ...configureWrappedCoreRule('key-spacing'),
329
326
  '@typescript-eslint/block-spacing': 'off',
330
327
  '@typescript-eslint/no-unsafe-enum-comparison': 'error',
331
328
  '@typescript-eslint/class-methods-use-this': 'error',