@robinblomberg/eslint-config-robinblomberg 0.17.0-beta7 → 0.18.1

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 +188 -174
  2. package/package.json +2 -2
package/index.js CHANGED
@@ -29,7 +29,8 @@ module.exports = defineConfig({
29
29
  rules: {
30
30
  '@typescript-eslint/adjacent-overload-signatures': warn,
31
31
  '@typescript-eslint/array-type': [warn, { default: 'array' }],
32
- '@typescript-eslint/await-thenable': warn,
32
+ // Disabled due to slow performance:
33
+ '@typescript-eslint/await-thenable': off,
33
34
  '@typescript-eslint/ban-ts-comment': warn,
34
35
  '@typescript-eslint/ban-tslint-comment': warn,
35
36
  '@typescript-eslint/ban-types': [
@@ -221,7 +222,7 @@ module.exports = defineConfig({
221
222
  '@typescript-eslint/no-dynamic-delete': off,
222
223
  '@typescript-eslint/no-empty-function': off,
223
224
  '@typescript-eslint/no-empty-interface': warn,
224
- '@typescript-eslint/no-explicit-any': off,
225
+ '@typescript-eslint/no-explicit-any': warn,
225
226
  '@typescript-eslint/no-extra-non-null-assertion': warn,
226
227
  '@typescript-eslint/no-extra-parens': [
227
228
  warn,
@@ -233,8 +234,9 @@ module.exports = defineConfig({
233
234
  ],
234
235
  '@typescript-eslint/no-extra-semi': warn,
235
236
  '@typescript-eslint/no-extraneous-class': off,
237
+ // Disabled due to slow performance:
236
238
  '@typescript-eslint/no-floating-promises': [
237
- warn,
239
+ off,
238
240
  {
239
241
  ignoreIIFE: true,
240
242
  ignoreVoid: true,
@@ -264,14 +266,15 @@ module.exports = defineConfig({
264
266
  '@typescript-eslint/no-non-null-assertion': off,
265
267
  '@typescript-eslint/no-parameter-properties': off,
266
268
  '@typescript-eslint/no-redeclare': off,
267
- '@typescript-eslint/no-require-imports': warn,
269
+ '@typescript-eslint/no-require-imports': off,
268
270
  '@typescript-eslint/no-shadow': warn,
269
271
  '@typescript-eslint/no-this-alias': warn,
270
272
  '@typescript-eslint/no-throw-literal': warn,
271
273
  '@typescript-eslint/no-type-alias': off,
272
274
  '@typescript-eslint/no-unnecessary-boolean-literal-compare': warn,
273
275
  '@typescript-eslint/no-unnecessary-condition': off,
274
- '@typescript-eslint/no-unnecessary-qualifier': warn,
276
+ // Disabled due to slow performance:
277
+ '@typescript-eslint/no-unnecessary-qualifier': off,
275
278
  '@typescript-eslint/no-unnecessary-type-arguments': off,
276
279
  '@typescript-eslint/no-unnecessary-type-assertion': warn,
277
280
  '@typescript-eslint/no-unsafe-assignment': off,
@@ -399,10 +402,9 @@ module.exports = defineConfig({
399
402
  'require-await': off,
400
403
  semi: off,
401
404
  'space-before-function-paren': off,
402
- 'unicorn/prefer-module': off,
403
405
  },
404
406
  },
405
- // Taken from `storybook/recommended`:
407
+ // Based on `storybook/recommended`:
406
408
  {
407
409
  files: [
408
410
  '*.stories.@(ts|tsx|js|jsx|mjs|cjs)',
@@ -410,6 +412,7 @@ module.exports = defineConfig({
410
412
  ],
411
413
  rules: {
412
414
  'import/no-anonymous-default-export': off,
415
+ 'react/no-multi-comp': off,
413
416
  'storybook/await-interactions': error,
414
417
  'storybook/context-in-play-function': error,
415
418
  'storybook/default-exports': error,
@@ -421,7 +424,7 @@ module.exports = defineConfig({
421
424
  'storybook/use-storybook-testing-library': error,
422
425
  },
423
426
  },
424
- // Taken from `storybook/recommended`:
427
+ // Based on `storybook/recommended`:
425
428
  {
426
429
  files: ['.storybook/main.@(js|cjs|mjs|ts)'],
427
430
  rules: {
@@ -444,6 +447,7 @@ module.exports = defineConfig({
444
447
  '@typescript-eslint/no-magic-numbers': off,
445
448
  'jsdoc/require-jsdoc': off,
446
449
  'no-magic-numbers': off,
450
+ 'sonarjs/no-duplicate-string': off,
447
451
  'sort-keys': off,
448
452
  },
449
453
  },
@@ -657,7 +661,8 @@ module.exports = defineConfig({
657
661
  'react/no-unused-state': warn,
658
662
  'react/no-will-update-set-state': warn,
659
663
  'react/prefer-es6-class': warn,
660
- 'react/prefer-read-only-props': warn,
664
+ // Props are seldom mutated anyway:
665
+ 'react/prefer-read-only-props': off,
661
666
  'react/prefer-stateless-function': warn,
662
667
  'react/prop-types': off,
663
668
  'react/react-in-jsx-scope': off,
@@ -734,15 +739,150 @@ module.exports = defineConfig({
734
739
  },
735
740
  },
736
741
  {
737
- files: [
738
- '**/*.stories.js',
739
- '**/*.stories.jsx',
740
- '**/*.stories.ts',
741
- '**/*.stories.tsx',
742
- ],
742
+ files: ['**/*.js'],
743
743
  rules: {
744
- 'import/no-default-export': off,
745
- 'react/no-multi-comp': off,
744
+ 'jsdoc/check-access': warn,
745
+ 'jsdoc/check-alignment': warn,
746
+ 'jsdoc/check-examples': off,
747
+ 'jsdoc/check-indentation': [off, { excludeTags: ['example'] }],
748
+ 'jsdoc/check-line-alignment': warn,
749
+ 'jsdoc/check-param-names': warn,
750
+ 'jsdoc/check-property-names': warn,
751
+ 'jsdoc/check-syntax': warn,
752
+ 'jsdoc/check-tag-names': warn,
753
+ 'jsdoc/check-types': [warn, { noDefaults: true }],
754
+ 'jsdoc/check-values': warn,
755
+ 'jsdoc/empty-tags': warn,
756
+ 'jsdoc/implements-on-classes': warn,
757
+ 'jsdoc/match-description': warn,
758
+ 'jsdoc/no-bad-blocks': warn,
759
+ 'jsdoc/no-defaults': warn,
760
+ 'jsdoc/no-types': off,
761
+ // Disabled due to false positives when referring to a generic type from inside its function:
762
+ 'jsdoc/no-undefined-types': [
763
+ off,
764
+ {
765
+ definedTypes: [
766
+ 'unknown',
767
+ /**
768
+ * @see typescript\lib\lib.es5.d.ts
769
+ * @version 4.1.2
770
+ */
771
+ 'PropertyKey',
772
+ 'PropertyDescriptor',
773
+ 'PropertyDescriptorMap',
774
+ 'ObjectConstructor',
775
+ 'FunctionConstructor',
776
+ 'ThisParameterType',
777
+ 'OmitThisParameter',
778
+ 'CallableFunction',
779
+ 'NewableFunction',
780
+ 'IArguments',
781
+ 'StringConstructor',
782
+ 'BooleanConstructor',
783
+ 'NumberConstructor',
784
+ 'TemplateStringsArray',
785
+ 'ImportMeta',
786
+ 'DateConstructor',
787
+ 'RegExpMatchArray',
788
+ 'RegExpExecArray',
789
+ 'RegExpConstructor',
790
+ 'ErrorConstructor',
791
+ 'EvalErrorConstructor',
792
+ 'RangeErrorConstructor',
793
+ 'ReferenceErrorConstructor',
794
+ 'SyntaxErrorConstructor',
795
+ 'TypeErrorConstructor',
796
+ 'URIErrorConstructor',
797
+ 'ReadonlyArray',
798
+ 'ConcatArray',
799
+ 'ArrayConstructor',
800
+ 'TypedPropertyDescriptor',
801
+ 'ClassDecorator',
802
+ 'PropertyDecorator',
803
+ 'MethodDecorator',
804
+ 'ParameterDecorator',
805
+ 'PromiseConstructorLike',
806
+ 'PromiseLike',
807
+ 'ArrayLike',
808
+ 'Partial',
809
+ 'Required',
810
+ 'Readonly',
811
+ 'Pick',
812
+ 'Exclude',
813
+ 'Extract',
814
+ 'Omit',
815
+ 'NonNullable',
816
+ 'Parameters',
817
+ 'ConstructorParameters',
818
+ 'ReturnType',
819
+ 'InstanceType',
820
+ 'ThisType',
821
+ 'ArrayBufferTypes',
822
+ 'ArrayBufferLike',
823
+ 'ArrayBufferConstructor',
824
+ 'ArrayBufferView',
825
+ 'DataViewConstructor',
826
+ 'Int8ArrayConstructor',
827
+ 'Uint8ArrayConstructor',
828
+ 'Uint8ClampedArrayConstructor',
829
+ 'Int16ArrayConstructor',
830
+ 'Uint16ArrayConstructor',
831
+ 'Int32ArrayConstructor',
832
+ 'Uint32ArrayConstructor',
833
+ 'Float32ArrayConstructor',
834
+ 'Float64ArrayConstructor',
835
+ ],
836
+ },
837
+ ],
838
+ 'jsdoc/require-description': [
839
+ off,
840
+ {
841
+ contexts: ['any'],
842
+ descriptionStyle: 'body',
843
+ },
844
+ ],
845
+ 'jsdoc/require-description-complete-sentence': off,
846
+ 'jsdoc/require-example': off,
847
+ 'jsdoc/require-file-overview': off,
848
+ 'jsdoc/require-hyphen-before-param-description': [warn, 'never'],
849
+ 'jsdoc/require-jsdoc': [
850
+ warn,
851
+ {
852
+ exemptEmptyFunctions: true,
853
+ publicOnly: false,
854
+ require: {
855
+ ArrowFunctionExpression: true,
856
+ ClassDeclaration: false,
857
+ ClassExpression: false,
858
+ FunctionDeclaration: true,
859
+ FunctionExpression: true,
860
+ MethodDefinition: true,
861
+ },
862
+ },
863
+ ],
864
+ 'jsdoc/require-param': [
865
+ warn,
866
+ {
867
+ checkConstructors: true,
868
+ checkDestructured: true,
869
+ checkDestructuredRoots: true,
870
+ checkGetters: true,
871
+ checkSetters: true,
872
+ },
873
+ ],
874
+ 'jsdoc/require-param-description': off,
875
+ 'jsdoc/require-param-name': warn,
876
+ 'jsdoc/require-param-type': [warn, { contexts: ['any'] }],
877
+ 'jsdoc/require-property': warn,
878
+ 'jsdoc/require-property-description': warn,
879
+ 'jsdoc/require-property-name': warn,
880
+ 'jsdoc/require-property-type': warn,
881
+ 'jsdoc/require-returns': off,
882
+ 'jsdoc/require-returns-check': warn,
883
+ 'jsdoc/require-returns-description': off,
884
+ 'jsdoc/require-returns-type': warn,
885
+ 'jsdoc/valid-types': off,
746
886
  },
747
887
  },
748
888
  ],
@@ -839,9 +979,11 @@ module.exports = defineConfig({
839
979
  'import/no-commonjs': off,
840
980
  'import/no-cycle': off,
841
981
  'import/no-default-export': off,
842
- 'import/no-deprecated': warn,
843
- 'import/no-duplicates': warn,
844
- 'import/no-dynamic-require': warn,
982
+ // Disabled due to slow performance:
983
+ 'import/no-deprecated': off,
984
+ // Disabled due to slow performance, and because it's duplicated by `no-duplicate-imports`:
985
+ 'import/no-duplicates': off,
986
+ 'import/no-dynamic-require': off,
845
987
  'import/no-extraneous-dependencies': warn,
846
988
  'import/no-internal-modules': [
847
989
  off,
@@ -856,12 +998,14 @@ module.exports = defineConfig({
856
998
  'import/no-nodejs-modules': off,
857
999
  // Disabled due to false positives (e.g. "@robinblomberg/schema"):
858
1000
  'import/no-relative-parent-imports': off,
859
- 'import/no-restricted-paths': warn,
860
- 'import/no-self-import': warn,
1001
+ 'import/no-restricted-paths': off,
1002
+ // Disabled due to slow performance:
1003
+ 'import/no-self-import': off,
861
1004
  'import/no-unassigned-import': warn,
862
1005
  'import/no-unresolved': warn,
863
1006
  'import/no-unused-modules': warn,
864
- 'import/no-useless-path-segments': warn,
1007
+ // Disabled due to slow performance:
1008
+ 'import/no-useless-path-segments': off,
865
1009
  'import/no-webpack-loader-syntax': warn,
866
1010
  /* 'import/order': [warn, {
867
1011
  alphabetize: {
@@ -884,148 +1028,6 @@ module.exports = defineConfig({
884
1028
  'import/unambiguous': off,
885
1029
  indent: [warn, 2, { SwitchCase: 1 }],
886
1030
  'init-declarations': off,
887
- 'jsdoc/check-access': warn,
888
- 'jsdoc/check-alignment': warn,
889
- 'jsdoc/check-examples': off,
890
- 'jsdoc/check-indentation': [off, { excludeTags: ['example'] }],
891
- 'jsdoc/check-line-alignment': warn,
892
- 'jsdoc/check-param-names': warn,
893
- 'jsdoc/check-property-names': warn,
894
- 'jsdoc/check-syntax': warn,
895
- 'jsdoc/check-tag-names': warn,
896
- 'jsdoc/check-types': [warn, { noDefaults: true }],
897
- 'jsdoc/check-values': warn,
898
- 'jsdoc/empty-tags': warn,
899
- 'jsdoc/implements-on-classes': warn,
900
- 'jsdoc/match-description': warn,
901
- 'jsdoc/no-bad-blocks': warn,
902
- 'jsdoc/no-defaults': warn,
903
- 'jsdoc/no-types': off,
904
- // Disabled due to false positives when referring to a generic type from inside its function:
905
- 'jsdoc/no-undefined-types': [
906
- off,
907
- {
908
- definedTypes: [
909
- 'unknown',
910
- /**
911
- * @see typescript\lib\lib.es5.d.ts
912
- * @version 4.1.2
913
- */
914
- 'PropertyKey',
915
- 'PropertyDescriptor',
916
- 'PropertyDescriptorMap',
917
- 'ObjectConstructor',
918
- 'FunctionConstructor',
919
- 'ThisParameterType',
920
- 'OmitThisParameter',
921
- 'CallableFunction',
922
- 'NewableFunction',
923
- 'IArguments',
924
- 'StringConstructor',
925
- 'BooleanConstructor',
926
- 'NumberConstructor',
927
- 'TemplateStringsArray',
928
- 'ImportMeta',
929
- 'DateConstructor',
930
- 'RegExpMatchArray',
931
- 'RegExpExecArray',
932
- 'RegExpConstructor',
933
- 'ErrorConstructor',
934
- 'EvalErrorConstructor',
935
- 'RangeErrorConstructor',
936
- 'ReferenceErrorConstructor',
937
- 'SyntaxErrorConstructor',
938
- 'TypeErrorConstructor',
939
- 'URIErrorConstructor',
940
- 'ReadonlyArray',
941
- 'ConcatArray',
942
- 'ArrayConstructor',
943
- 'TypedPropertyDescriptor',
944
- 'ClassDecorator',
945
- 'PropertyDecorator',
946
- 'MethodDecorator',
947
- 'ParameterDecorator',
948
- 'PromiseConstructorLike',
949
- 'PromiseLike',
950
- 'ArrayLike',
951
- 'Partial',
952
- 'Required',
953
- 'Readonly',
954
- 'Pick',
955
- 'Exclude',
956
- 'Extract',
957
- 'Omit',
958
- 'NonNullable',
959
- 'Parameters',
960
- 'ConstructorParameters',
961
- 'ReturnType',
962
- 'InstanceType',
963
- 'ThisType',
964
- 'ArrayBufferTypes',
965
- 'ArrayBufferLike',
966
- 'ArrayBufferConstructor',
967
- 'ArrayBufferView',
968
- 'DataViewConstructor',
969
- 'Int8ArrayConstructor',
970
- 'Uint8ArrayConstructor',
971
- 'Uint8ClampedArrayConstructor',
972
- 'Int16ArrayConstructor',
973
- 'Uint16ArrayConstructor',
974
- 'Int32ArrayConstructor',
975
- 'Uint32ArrayConstructor',
976
- 'Float32ArrayConstructor',
977
- 'Float64ArrayConstructor',
978
- ],
979
- },
980
- ],
981
- 'jsdoc/require-description': [
982
- off,
983
- {
984
- contexts: ['any'],
985
- descriptionStyle: 'body',
986
- },
987
- ],
988
- 'jsdoc/require-description-complete-sentence': off,
989
- 'jsdoc/require-example': off,
990
- 'jsdoc/require-file-overview': off,
991
- 'jsdoc/require-hyphen-before-param-description': [warn, 'never'],
992
- 'jsdoc/require-jsdoc': [
993
- warn,
994
- {
995
- exemptEmptyFunctions: true,
996
- publicOnly: false,
997
- require: {
998
- ArrowFunctionExpression: true,
999
- ClassDeclaration: false,
1000
- ClassExpression: false,
1001
- FunctionDeclaration: true,
1002
- FunctionExpression: true,
1003
- MethodDefinition: true,
1004
- },
1005
- },
1006
- ],
1007
- 'jsdoc/require-param': [
1008
- warn,
1009
- {
1010
- checkConstructors: true,
1011
- checkDestructured: true,
1012
- checkDestructuredRoots: true,
1013
- checkGetters: true,
1014
- checkSetters: true,
1015
- },
1016
- ],
1017
- 'jsdoc/require-param-description': off,
1018
- 'jsdoc/require-param-name': warn,
1019
- 'jsdoc/require-param-type': [warn, { contexts: ['any'] }],
1020
- 'jsdoc/require-property': warn,
1021
- 'jsdoc/require-property-description': warn,
1022
- 'jsdoc/require-property-name': warn,
1023
- 'jsdoc/require-property-type': warn,
1024
- 'jsdoc/require-returns': off,
1025
- 'jsdoc/require-returns-check': warn,
1026
- 'jsdoc/require-returns-description': off,
1027
- 'jsdoc/require-returns-type': warn,
1028
- 'jsdoc/valid-types': off,
1029
1031
  'jsx-quotes': warn,
1030
1032
  'key-spacing': [warn, { afterColon: true, beforeColon: false }],
1031
1033
  'keyword-spacing': [off, { after: true, before: true }],
@@ -1368,7 +1370,8 @@ module.exports = defineConfig({
1368
1370
  'sonarjs/no-element-overwrite': warn,
1369
1371
  'sonarjs/no-empty-collection': warn,
1370
1372
  'sonarjs/no-extra-arguments': warn,
1371
- 'sonarjs/no-gratuitous-expressions': warn,
1373
+ // Disabled due to slow performance:
1374
+ 'sonarjs/no-gratuitous-expressions': off,
1372
1375
  'sonarjs/no-identical-conditions': warn,
1373
1376
  'sonarjs/no-identical-expressions': warn,
1374
1377
  'sonarjs/no-identical-functions': warn,
@@ -1441,7 +1444,15 @@ module.exports = defineConfig({
1441
1444
  'unicorn/escape-case': warn,
1442
1445
  'unicorn/expiring-todo-comments': warn,
1443
1446
  'unicorn/explicit-length-check': warn,
1444
- 'unicorn/filename-case': warn,
1447
+ 'unicorn/filename-case': [
1448
+ warn,
1449
+ {
1450
+ cases: {
1451
+ kebabCase: true,
1452
+ pascalCase: true,
1453
+ },
1454
+ },
1455
+ ],
1445
1456
  'unicorn/import-style': warn,
1446
1457
  'unicorn/new-for-builtins': warn,
1447
1458
  'unicorn/no-abusive-eslint-disable': warn,
@@ -1468,7 +1479,8 @@ module.exports = defineConfig({
1468
1479
  'unicorn/no-object-as-default-parameter': warn,
1469
1480
  'unicorn/no-process-exit': warn,
1470
1481
  'unicorn/no-static-only-class': warn,
1471
- 'unicorn/no-thenable': warn,
1482
+ // Disabled due to slow performance:
1483
+ 'unicorn/no-thenable': off,
1472
1484
  'unicorn/no-this-assignment': warn,
1473
1485
  'unicorn/no-typeof-undefined': warn,
1474
1486
  'unicorn/no-unnecessary-await': warn,
@@ -1480,19 +1492,20 @@ module.exports = defineConfig({
1480
1492
  'unicorn/no-useless-promise-resolve-reject': warn,
1481
1493
  'unicorn/no-useless-spread': warn,
1482
1494
  'unicorn/no-useless-switch-case': warn,
1483
- 'unicorn/no-useless-undefined': warn,
1495
+ 'unicorn/no-useless-undefined': off,
1484
1496
  'unicorn/no-zero-fractions': warn,
1485
1497
  'unicorn/number-literal-case': off,
1486
1498
  'unicorn/numeric-separators-style': warn,
1487
1499
  'unicorn/prefer-add-event-listener': warn,
1488
1500
  'unicorn/prefer-array-find': warn,
1489
1501
  'unicorn/prefer-array-flat-map': warn,
1490
- 'unicorn/prefer-array-flat': warn,
1502
+ // Disabled due to slow performance:
1503
+ 'unicorn/prefer-array-flat': off,
1491
1504
  'unicorn/prefer-array-index-of': warn,
1492
1505
  'unicorn/prefer-array-some': warn,
1493
1506
  'unicorn/prefer-at': warn,
1494
1507
  'unicorn/prefer-blob-reading-methods': warn,
1495
- 'unicorn/prefer-code-point': warn,
1508
+ 'unicorn/prefer-code-point': off,
1496
1509
  'unicorn/prefer-date-now': warn,
1497
1510
  'unicorn/prefer-default-parameters': warn,
1498
1511
  'unicorn/prefer-dom-node-append': warn,
@@ -1508,7 +1521,7 @@ module.exports = defineConfig({
1508
1521
  'unicorn/prefer-math-trunc': warn,
1509
1522
  'unicorn/prefer-modern-dom-apis': warn,
1510
1523
  'unicorn/prefer-modern-math-apis': warn,
1511
- 'unicorn/prefer-module': warn,
1524
+ 'unicorn/prefer-module': off,
1512
1525
  'unicorn/prefer-native-coercion-functions': warn,
1513
1526
  'unicorn/prefer-negative-index': warn,
1514
1527
  'unicorn/prefer-node-protocol': error,
@@ -1521,13 +1534,14 @@ module.exports = defineConfig({
1521
1534
  'unicorn/prefer-regexp-test': warn,
1522
1535
  'unicorn/prefer-set-has': warn,
1523
1536
  'unicorn/prefer-set-size': warn,
1524
- 'unicorn/prefer-spread': warn,
1537
+ // Disabled due to slow performance:
1538
+ 'unicorn/prefer-spread': off,
1525
1539
  'unicorn/prefer-string-replace-all': warn,
1526
1540
  'unicorn/prefer-string-slice': warn,
1527
1541
  'unicorn/prefer-string-starts-ends-with': warn,
1528
1542
  'unicorn/prefer-string-trim-start-end': warn,
1529
1543
  'unicorn/prefer-switch': warn,
1530
- 'unicorn/prefer-ternary': warn,
1544
+ 'unicorn/prefer-ternary': off,
1531
1545
  'unicorn/prefer-top-level-await': warn,
1532
1546
  'unicorn/prefer-type-error': warn,
1533
1547
  'unicorn/prevent-abbreviations': off,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@robinblomberg/eslint-config-robinblomberg",
3
- "version": "0.17.0-beta7",
3
+ "version": "0.18.1",
4
4
  "author": "Robin Blomberg",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -28,7 +28,7 @@
28
28
  "eslint-plugin-unicorn": "^48.0.1"
29
29
  },
30
30
  "devDependencies": {
31
- "@robinblomberg/eslint-config-robinblomberg": "0.17.0-beta5",
31
+ "@robinblomberg/eslint-config-robinblomberg": "0.18.0",
32
32
  "@types/node": "*"
33
33
  },
34
34
  "peerDependencies": {