eslint-config-sukka 3.0.1 → 3.0.3
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/legacy.js +1 -1
- package/node.js +1 -1
- package/package.json +1 -1
- package/react.js +10 -1
- package/typescript.js +85 -6
package/legacy.js
CHANGED
|
@@ -246,7 +246,7 @@ module.exports = {
|
|
|
246
246
|
'no-multi-assign': ['error'],
|
|
247
247
|
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
248
248
|
'no-negated-condition': 'off',
|
|
249
|
-
'no-nested-ternary': '
|
|
249
|
+
'no-nested-ternary': 'warn',
|
|
250
250
|
'no-new-object': 'error',
|
|
251
251
|
'no-ternary': 'off',
|
|
252
252
|
'no-trailing-spaces': 'error',
|
package/node.js
CHANGED
|
@@ -304,7 +304,7 @@ module.exports = {
|
|
|
304
304
|
'no-multi-assign': ['error'],
|
|
305
305
|
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
306
306
|
'no-negated-condition': 'off',
|
|
307
|
-
'no-nested-ternary': '
|
|
307
|
+
'no-nested-ternary': 'warn',
|
|
308
308
|
'no-new-object': 'error',
|
|
309
309
|
'no-ternary': 'off',
|
|
310
310
|
'no-trailing-spaces': 'error',
|
package/package.json
CHANGED
package/react.js
CHANGED
|
@@ -303,7 +303,7 @@ module.exports = {
|
|
|
303
303
|
'no-multi-assign': ['error'],
|
|
304
304
|
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
305
305
|
'no-negated-condition': 'off',
|
|
306
|
-
'no-nested-ternary': '
|
|
306
|
+
'no-nested-ternary': 'warn',
|
|
307
307
|
'no-new-object': 'error',
|
|
308
308
|
'no-ternary': 'off',
|
|
309
309
|
'no-trailing-spaces': 'error',
|
|
@@ -578,6 +578,15 @@ module.exports = {
|
|
|
578
578
|
{ name: 'NextLink', props: ['href'] }
|
|
579
579
|
]
|
|
580
580
|
],
|
|
581
|
+
'react/jsx-key': [
|
|
582
|
+
'warn',
|
|
583
|
+
{
|
|
584
|
+
checkFragmentShorthand: true,
|
|
585
|
+
checkKeyMustBeforeSpread: true,
|
|
586
|
+
warnOnDuplicates: true
|
|
587
|
+
}
|
|
588
|
+
],
|
|
589
|
+
'react/jsx-uses-vars': 'error',
|
|
581
590
|
'react/jsx-no-useless-fragment': 'error',
|
|
582
591
|
'react/jsx-no-constructed-context-values': 'error',
|
|
583
592
|
'react/no-unstable-nested-components': 'error',
|
package/typescript.js
CHANGED
|
@@ -287,7 +287,7 @@ module.exports = {
|
|
|
287
287
|
'no-multi-assign': ['error'],
|
|
288
288
|
'no-multiple-empty-lines': ['error', { max: 1, maxBOF: 0, maxEOF: 0 }],
|
|
289
289
|
'no-negated-condition': 'off',
|
|
290
|
-
'no-nested-ternary': '
|
|
290
|
+
'no-nested-ternary': 'warn',
|
|
291
291
|
'no-new-object': 'error',
|
|
292
292
|
'no-ternary': 'off',
|
|
293
293
|
'no-trailing-spaces': 'error',
|
|
@@ -402,6 +402,16 @@ module.exports = {
|
|
|
402
402
|
'top'
|
|
403
403
|
],
|
|
404
404
|
'no-undef-init': 'error',
|
|
405
|
+
'@typescript-eslint/ban-ts-comment': [
|
|
406
|
+
'error',
|
|
407
|
+
{
|
|
408
|
+
'ts-expect-error': 'allow-with-description',
|
|
409
|
+
'ts-ignore': true,
|
|
410
|
+
'ts-nocheck': true,
|
|
411
|
+
'ts-check': false,
|
|
412
|
+
minimumDescriptionLength: 5
|
|
413
|
+
}
|
|
414
|
+
],
|
|
405
415
|
'@typescript-eslint/naming-convention': [
|
|
406
416
|
'warn',
|
|
407
417
|
{
|
|
@@ -447,11 +457,14 @@ module.exports = {
|
|
|
447
457
|
'warn',
|
|
448
458
|
{
|
|
449
459
|
prefer: 'type-imports',
|
|
450
|
-
disallowTypeAnnotations:
|
|
460
|
+
disallowTypeAnnotations: false,
|
|
451
461
|
fixStyle: 'separate-type-imports'
|
|
452
462
|
}
|
|
453
463
|
],
|
|
454
|
-
'@typescript-eslint/consistent-type-exports':
|
|
464
|
+
'@typescript-eslint/consistent-type-exports': [
|
|
465
|
+
'warn',
|
|
466
|
+
{ fixMixedExportsWithInlineTypeSpecifier: true }
|
|
467
|
+
],
|
|
455
468
|
'@typescript-eslint/consistent-type-definitions': 'warn',
|
|
456
469
|
'@typescript-eslint/prefer-ts-expect-error': 'warn',
|
|
457
470
|
'@typescript-eslint/member-delimiter-style': [
|
|
@@ -472,7 +485,7 @@ module.exports = {
|
|
|
472
485
|
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
473
486
|
'@typescript-eslint/no-dynamic-delete': 'warn',
|
|
474
487
|
'@typescript-eslint/no-extraneous-class': [
|
|
475
|
-
'
|
|
488
|
+
'warn',
|
|
476
489
|
{
|
|
477
490
|
allowConstructorOnly: true,
|
|
478
491
|
allowEmpty: true,
|
|
@@ -507,9 +520,76 @@ module.exports = {
|
|
|
507
520
|
'@typescript-eslint/prefer-for-of': 'off',
|
|
508
521
|
'@typescript-eslint/prefer-function-type': 'off',
|
|
509
522
|
'@typescript-eslint/consistent-indexed-object-style': 'off',
|
|
510
|
-
'@typescript-eslint/
|
|
523
|
+
'@typescript-eslint/prefer-enum-initializers': 'warn',
|
|
524
|
+
'@typescript-eslint/no-duplicate-enum-values': 'error',
|
|
525
|
+
'@typescript-eslint/no-extra-non-null-assertion': 'error',
|
|
526
|
+
'@typescript-eslint/no-meaningless-void-operator': 'warn',
|
|
527
|
+
'@typescript-eslint/no-unnecessary-qualifier': 'warn',
|
|
528
|
+
'@typescript-eslint/array-type': ['warn', { default: 'array-simple' }],
|
|
529
|
+
'@typescript-eslint/no-restricted-imports': [
|
|
530
|
+
'error',
|
|
531
|
+
{
|
|
532
|
+
paths: [
|
|
533
|
+
{
|
|
534
|
+
name: 'date-fns',
|
|
535
|
+
message: 'Please use date-fns/{submodule} instead.',
|
|
536
|
+
allowTypeImports: true
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
name: 'date-fns/esm',
|
|
540
|
+
message: 'Please use date-fns/{submodule} instead.'
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
name: 'idb/with-async-ittr-cjs',
|
|
544
|
+
message: 'Please use idb/with-async-ittr instead.'
|
|
545
|
+
},
|
|
546
|
+
{
|
|
547
|
+
name: 'async-call-rpc',
|
|
548
|
+
message: 'Please use async-call-rpc/full instead.',
|
|
549
|
+
allowTypeImports: true
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
name: 'lodash-es',
|
|
553
|
+
message: 'Avoid using type unsafe methods.',
|
|
554
|
+
importNames: ['get']
|
|
555
|
+
}
|
|
556
|
+
]
|
|
557
|
+
}
|
|
558
|
+
],
|
|
559
|
+
'@typescript-eslint/ban-types': [
|
|
560
|
+
'error',
|
|
561
|
+
{
|
|
562
|
+
types: {
|
|
563
|
+
'{}': false,
|
|
564
|
+
FC: {
|
|
565
|
+
message:
|
|
566
|
+
'To declare a component, you don\'t have to use FC to annotate it. To type something that accepts/is a React Component, use ComponentType<T>.',
|
|
567
|
+
fixWith: 'ComponentType'
|
|
568
|
+
},
|
|
569
|
+
ReactElement: {
|
|
570
|
+
message:
|
|
571
|
+
'In most cases, you want ReactNode. Only ignore this rule when you want to use cloneElement.',
|
|
572
|
+
fixWith: 'ReactNode'
|
|
573
|
+
},
|
|
574
|
+
'React.FC': {
|
|
575
|
+
message:
|
|
576
|
+
'To declare a component, you don\'t have to use React.FC to annotate it. To type something that accepts/is a React Component, use React.ComponentType<T>.',
|
|
577
|
+
fixWith: 'React.ComponentType'
|
|
578
|
+
},
|
|
579
|
+
'React.ReactElement': {
|
|
580
|
+
message:
|
|
581
|
+
'In most cases, you want React.ReactNode. Only ignore this rule when you want to use cloneElement.',
|
|
582
|
+
fixWith: 'React.ReactNode'
|
|
583
|
+
}
|
|
584
|
+
},
|
|
585
|
+
extendDefaults: true
|
|
586
|
+
}
|
|
587
|
+
],
|
|
511
588
|
'@typescript-eslint/no-unsafe-assignment': 'off',
|
|
512
589
|
'@typescript-eslint/no-explicit-any': 'warn',
|
|
590
|
+
'@typescript-eslint/no-loop-func': 'error',
|
|
591
|
+
'@typescript-eslint/no-redundant-type-constituents': 'off',
|
|
592
|
+
'@typescript-eslint/no-floating-promises': 'off',
|
|
513
593
|
'@fluffyfox/array/no-unneeded-flat-map': 'error',
|
|
514
594
|
'@fluffyfox/array/prefer-from': 'error',
|
|
515
595
|
'@fluffyfox/browser/no-set-html': 'off',
|
|
@@ -542,7 +622,6 @@ module.exports = {
|
|
|
542
622
|
'@typescript-eslint/dot-notation': ['error', { allowKeywords: true }],
|
|
543
623
|
'@typescript-eslint/no-implied-eval': 'error',
|
|
544
624
|
'@typescript-eslint/no-invalid-this': 'off',
|
|
545
|
-
'@typescript-eslint/no-loop-func': 'error',
|
|
546
625
|
'@typescript-eslint/no-unused-expressions': [
|
|
547
626
|
'error',
|
|
548
627
|
{
|