linter-bundle 2.26.0 → 2.27.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.
- package/CHANGELOG.md +56 -4
- package/README.md +3 -3
- package/eslint/index.js +51 -14
- package/eslint/overrides-jest.js +37 -15
- package/eslint/overrides-jsdoc.js +3 -1
- package/eslint/overrides-react.js +7 -5
- package/helper/ensure-type.js +1 -1
- package/helper/find-missing-overrides.js +4 -4
- package/helper/is-npm-or-yarn.js +1 -1
- package/lint.js +4 -4
- package/package.json +20 -20
- package/stylelint/index.js +1 -0
- package/types.d.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,56 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
-
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.
|
|
9
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.27.0...HEAD)
|
|
10
|
+
|
|
11
|
+
## [2.27.0] - 2023-01-27
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- [eslint] Updated `@typescript-eslint` from `5.41.0` to `5.49.0`
|
|
16
|
+
- [eslint] Updated `eslint` from `8.26.0` to `8.32.0`
|
|
17
|
+
- [eslint] Updated `eslint-import-resolver-typescript` from `3.5.2` to `3.5.3`
|
|
18
|
+
- [eslint] Updated `eslint-plugin-import` from `2.26.0` to `2.27.5`
|
|
19
|
+
- [eslint] Updated `eslint-plugin-jest` from `27.1.3` to `27.2.1`
|
|
20
|
+
- [eslint] Updated `eslint-plugin-jsdoc` from `39.3.25` to `39.6.9`
|
|
21
|
+
- [eslint] Updated `eslint-plugin-jsx-a11y` from `6.6.1` to `6.7.1`
|
|
22
|
+
- [eslint] Updated `eslint-plugin-n` from `15.3.0` to `15.6.1`
|
|
23
|
+
- [eslint] Updated `eslint-plugin-react` from `7.31.10` to `7.32.1`
|
|
24
|
+
- [eslint] Updated `eslint-plugin-unicorn` from `44.0.2` to `45.0.2`
|
|
25
|
+
- [markdownlint] Updated `markdownlint-cli` from `0.32.2` to `0.33.0`
|
|
26
|
+
- [stylelint] Updated `postcss-scss` from `4.0.5` to `4.0.6`
|
|
27
|
+
- [stylelint] Updated `stylelint` from `14.14.0` to `14.16.1`
|
|
28
|
+
- [stylelint] Updated `stylelint-order` from `5.0.0` to `6.0.1`
|
|
29
|
+
- [eslint] Define order for getters and setters and private fields of [`@typescript-eslint/member-ordering`](https://typescript-eslint.io/rules/member-ordering/) rule
|
|
30
|
+
|
|
31
|
+
### Added
|
|
32
|
+
|
|
33
|
+
- [eslint] Added new [`no-empty-static-block`](https://eslint.org/docs/latest/rules/no-empty-static-block) rule
|
|
34
|
+
- [eslint] Added new [`no-new-native-nonconstructor`](https://eslint.org/docs/latest/rules/no-new-native-nonconstructor) rule
|
|
35
|
+
- [eslint] Added new [`import/no-empty-named-blocks`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-empty-named-blocks.md) rule
|
|
36
|
+
- [eslint] Added new [`import/consistent-type-specifier-style`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/consistent-type-specifier-style.md) rule, and used `"prefer-top-level"` option
|
|
37
|
+
- [eslint] Make use of new `alphabetize.orderImportKind` option of [`import/order`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/order.md) rule, and set it to `"asc"`
|
|
38
|
+
- [eslint] Make use of new `distinctGroup` option of [`import/order`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/order.md) rule, and set it to `false`
|
|
39
|
+
- [eslint] Make use of new `considerComments` option of [`import/newline-after-import`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/newline-after-import.md) rule, and set it to `true`
|
|
40
|
+
- [eslint] Added new [`unicorn/no-typeof-undefined`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-typeof-undefined.md) rule
|
|
41
|
+
- [eslint] Added, but disabled new [`unicorn/no-negated-condition`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negated-condition.md) rule
|
|
42
|
+
- [eslint] Added new [`unicorn/prefer-set-size`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-set-size.md) rule
|
|
43
|
+
- [eslint/overrides-jest] Added new [`jest/no-untyped-mock-factory`](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-untyped-mock-factory.md) rule for TypeScript files
|
|
44
|
+
- [eslint/overrides-jsdoc] Activate `exemptDestructuredRootsFromChecks` setting for the rules [`jsdoc/require-param-type`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-type) and
|
|
45
|
+
[`jsdoc/require-param-description`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-require-param-description)
|
|
46
|
+
- [eslint/overrides-jsdoc] Added, but disabled new [`jsdoc/text-escaping`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-text-escaping) rule
|
|
47
|
+
- [eslint/overrides-react] Added, but disabled new [`jsx-a11y/anchor-ambiguous-text`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/anchor-ambiguous-text.md) rule
|
|
48
|
+
- [eslint/overrides-react] Added new [`jsx-a11y/no-aria-hidden-on-focusable`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-aria-hidden-on-focusable.md) rule
|
|
49
|
+
- [eslint/overrides-react] Added new [`react/no-object-type-as-default-prop`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-object-type-as-default-prop.md) rule
|
|
50
|
+
- [eslint/overrides-react] Added new [`react/sort-default-props`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/sort-default-props.md) rule
|
|
51
|
+
- [eslint/overrides-react] Make use of new `allowDestructuredState` option of [`react/hook-use-state`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/hook-use-state.md) rule
|
|
52
|
+
- [stylelint] Added new [`media-feature-range-notation`](https://stylelint.io/user-guide/rules/media-feature-range-notation/) rule, and used `"prefix"` option
|
|
53
|
+
|
|
54
|
+
### Fixed
|
|
55
|
+
|
|
56
|
+
- [general] Fix typo in `linterBundleSettings.overrides.general.additionalRest*r*ictions`
|
|
57
|
+
|
|
58
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.26.0...v2.27.0)
|
|
10
59
|
|
|
11
60
|
## [2.26.0] - 2022-10-27
|
|
12
61
|
|
|
@@ -54,13 +103,16 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
54
103
|
- [eslint] Updated `eslint-plugin-react` from `7.31.8` to `7.31.10`
|
|
55
104
|
- [eslint] Updated `eslint-plugin-unicorn` from `43.0.2` to `44.0.2`
|
|
56
105
|
- [eslint] Moved `eslint-plugin-jsx-a11y` configuration to `eslint/overrides-react`
|
|
106
|
+
- [stylelint] Updated `stylelint` from `14.12.1` to `14.14.0`
|
|
107
|
+
- [stylelint] Ignore `!default` annotation in [`annotation-no-unknown`](https://stylelint.io/user-guide/rules/annotation-no-unknown/) rule
|
|
108
|
+
|
|
109
|
+
### Added
|
|
110
|
+
|
|
57
111
|
- [eslint] Added new [`logical-assignment-operators`](https://eslint.org/docs/latest/rules/logical-assignment-operators) rule with option `"always"`
|
|
58
112
|
- [eslint] Added new [`promise/no-multiple-resolved`](https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/no-multiple-resolved.md) rule
|
|
59
113
|
- [eslint] Make use of new [`unicorn/no-unnecessary-await`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-await.md) rule
|
|
60
114
|
- [eslint] Make use of new [`unicorn/switch-case-braces`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/switch-case-braces.md) rule with option `"avoid"`
|
|
61
115
|
- [eslint/overrides-jest] Added but disable new [`jest/no-restricted-jest-methods`](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-restricted-jest-methods.md) rule
|
|
62
|
-
- [stylelint] Updated `stylelint` from `14.12.1` to `14.14.0`
|
|
63
|
-
- [stylelint] Ignore `!default` annotation in [`annotation-no-unknown`](https://stylelint.io/user-guide/rules/annotation-no-unknown/) rule
|
|
64
116
|
|
|
65
117
|
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.24.0...v2.25.0)
|
|
66
118
|
|
|
@@ -798,7 +850,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
798
850
|
|
|
799
851
|
- [eslint] Updated `@typescript-eslint` from v4.24.0 to v4.25.0
|
|
800
852
|
- [eslint] Updated `eslint-plugin-jsdoc` from v34.8.2 to v35.0.0
|
|
801
|
-
- [eslint] Activated `ignoreNonDOM` option for `jsx-a11y/no-autofocus` rule
|
|
853
|
+
- [eslint] Activated `ignoreNonDOM` option for [`jsx-a11y/no-autofocus`](https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-autofocus.md) rule
|
|
802
854
|
|
|
803
855
|
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v1.20.0...v1.21.0)
|
|
804
856
|
|
package/README.md
CHANGED
|
@@ -109,7 +109,7 @@ global.linterBundleSettings = {
|
|
|
109
109
|
overrides: {
|
|
110
110
|
general: {
|
|
111
111
|
'no-restricted-globals': {
|
|
112
|
-
|
|
112
|
+
additionalRestrictions: [
|
|
113
113
|
{
|
|
114
114
|
name: 'fetch',
|
|
115
115
|
message: 'Use Utils.fetchWithTimeout() instead.'
|
|
@@ -117,7 +117,7 @@ global.linterBundleSettings = {
|
|
|
117
117
|
]
|
|
118
118
|
},
|
|
119
119
|
'no-restricted-properties': {
|
|
120
|
-
|
|
120
|
+
additionalRestrictions: [
|
|
121
121
|
{
|
|
122
122
|
object: 'localStorage',
|
|
123
123
|
property: 'getItem',
|
|
@@ -136,7 +136,7 @@ global.linterBundleSettings = {
|
|
|
136
136
|
]
|
|
137
137
|
},
|
|
138
138
|
'no-restricted-syntax': {
|
|
139
|
-
|
|
139
|
+
additionalRestrictions: [
|
|
140
140
|
{
|
|
141
141
|
selector: 'NewExpression[callee.name="Blob"]',
|
|
142
142
|
message: 'Use BlobHelper.create() instead of new Blob().'
|
package/eslint/index.js
CHANGED
|
@@ -205,6 +205,7 @@ module.exports = {
|
|
|
205
205
|
'no-empty-character-class': 'error',
|
|
206
206
|
'no-empty-function': 'off', // Covered by @typescript-eslint/no-empty-function
|
|
207
207
|
'no-empty-pattern': 'error',
|
|
208
|
+
'no-empty-static-block': 'error',
|
|
208
209
|
'no-empty': 'error',
|
|
209
210
|
'no-eq-null': 'error',
|
|
210
211
|
'no-eval': 'error',
|
|
@@ -246,6 +247,7 @@ module.exports = {
|
|
|
246
247
|
'no-negated-condition': 'off',
|
|
247
248
|
'no-nested-ternary': 'error',
|
|
248
249
|
'no-new-func': 'error',
|
|
250
|
+
'no-new-native-nonconstructor': 'error',
|
|
249
251
|
'no-new-object': 'error',
|
|
250
252
|
'no-new-symbol': 'error',
|
|
251
253
|
'no-new-wrappers': 'error',
|
|
@@ -268,16 +270,16 @@ module.exports = {
|
|
|
268
270
|
name: 'isNaN',
|
|
269
271
|
message: 'Use Number.isNaN() instead, and ensure that the input value is of type number. isNaN(undefined) !== Number.isNaN(undefined)'
|
|
270
272
|
},
|
|
271
|
-
...ensureType.array(global.linterBundleSettings?.overrides?.general?.['no-restricted-globals']?.
|
|
273
|
+
...ensureType.array(global.linterBundleSettings?.overrides?.general?.['no-restricted-globals']?.additionalRestrictions)
|
|
272
274
|
],
|
|
273
275
|
'no-restricted-imports': 'off', // Covered by @typescript-eslint/no-restricted-imports
|
|
274
276
|
'no-restricted-properties': [
|
|
275
277
|
'error',
|
|
276
|
-
...ensureType.array(global.linterBundleSettings?.overrides?.general?.['no-restricted-properties']?.
|
|
278
|
+
...ensureType.array(global.linterBundleSettings?.overrides?.general?.['no-restricted-properties']?.additionalRestrictions)
|
|
277
279
|
],
|
|
278
280
|
'no-restricted-syntax': [
|
|
279
281
|
'error',
|
|
280
|
-
...ensureType.array(global.linterBundleSettings?.overrides?.general?.['no-restricted-syntax']?.
|
|
282
|
+
...ensureType.array(global.linterBundleSettings?.overrides?.general?.['no-restricted-syntax']?.additionalRestrictions)
|
|
281
283
|
],
|
|
282
284
|
'no-return-assign': 'error',
|
|
283
285
|
'no-return-await': 'off', // Covered by @typescript-eslint/return-await
|
|
@@ -470,6 +472,7 @@ module.exports = {
|
|
|
470
472
|
// Fields
|
|
471
473
|
'public-static-field',
|
|
472
474
|
'protected-static-field',
|
|
475
|
+
'#private-static-field',
|
|
473
476
|
'private-static-field',
|
|
474
477
|
|
|
475
478
|
'public-decorated-field',
|
|
@@ -478,32 +481,59 @@ module.exports = {
|
|
|
478
481
|
|
|
479
482
|
'public-instance-field',
|
|
480
483
|
'protected-instance-field',
|
|
484
|
+
'#private-instance-field',
|
|
481
485
|
'private-instance-field',
|
|
482
486
|
|
|
483
487
|
'public-abstract-field',
|
|
484
488
|
'protected-abstract-field',
|
|
485
|
-
'private-abstract-field',
|
|
486
489
|
|
|
487
490
|
// Constructors
|
|
488
491
|
'public-constructor',
|
|
489
492
|
'protected-constructor',
|
|
490
493
|
'private-constructor',
|
|
491
494
|
|
|
492
|
-
// Methods
|
|
495
|
+
// Methods / Getters / Setters
|
|
496
|
+
'public-decorated-set',
|
|
497
|
+
'public-decorated-get',
|
|
493
498
|
'public-decorated-method',
|
|
499
|
+
'public-instance-set',
|
|
500
|
+
'public-instance-get',
|
|
494
501
|
'public-instance-method',
|
|
502
|
+
'public-static-set',
|
|
503
|
+
'public-static-get',
|
|
495
504
|
'public-static-method',
|
|
505
|
+
'public-abstract-get',
|
|
506
|
+
'public-abstract-set',
|
|
496
507
|
'public-abstract-method',
|
|
497
508
|
|
|
509
|
+
'protected-decorated-set',
|
|
510
|
+
'protected-decorated-get',
|
|
498
511
|
'protected-decorated-method',
|
|
512
|
+
'protected-instance-set',
|
|
513
|
+
'protected-instance-get',
|
|
499
514
|
'protected-instance-method',
|
|
515
|
+
'protected-static-set',
|
|
516
|
+
'protected-static-get',
|
|
500
517
|
'protected-static-method',
|
|
518
|
+
'protected-abstract-get',
|
|
519
|
+
'protected-abstract-set',
|
|
501
520
|
'protected-abstract-method',
|
|
502
521
|
|
|
522
|
+
'private-decorated-set',
|
|
523
|
+
'private-decorated-get',
|
|
503
524
|
'private-decorated-method',
|
|
525
|
+
'#private-instance-set',
|
|
526
|
+
'#private-instance-get',
|
|
527
|
+
'#private-instance-method',
|
|
528
|
+
'private-instance-set',
|
|
529
|
+
'private-instance-get',
|
|
504
530
|
'private-instance-method',
|
|
505
|
-
'private-static-
|
|
506
|
-
'private-
|
|
531
|
+
'#private-static-set',
|
|
532
|
+
'#private-static-get',
|
|
533
|
+
'#private-static-method',
|
|
534
|
+
'private-static-set',
|
|
535
|
+
'private-static-get',
|
|
536
|
+
'private-static-method'
|
|
507
537
|
]
|
|
508
538
|
}],
|
|
509
539
|
'@typescript-eslint/method-signature-style': ['error', 'property'],
|
|
@@ -539,7 +569,7 @@ module.exports = {
|
|
|
539
569
|
// Function
|
|
540
570
|
{ selector: 'function', format: ['camelCase', 'PascalCase'] },
|
|
541
571
|
|
|
542
|
-
//
|
|
572
|
+
// Parameter
|
|
543
573
|
{ selector: 'parameter', format: ['camelCase', 'PascalCase'], leadingUnderscore: 'allow' },
|
|
544
574
|
|
|
545
575
|
// Property
|
|
@@ -574,7 +604,7 @@ module.exports = {
|
|
|
574
604
|
format: null
|
|
575
605
|
},
|
|
576
606
|
{
|
|
577
|
-
// Allow properties which which don't contain an underscore (to prevent usage of "UPPER_CASE") and contain
|
|
607
|
+
// Allow properties which which don't contain an underscore (to prevent usage of "UPPER_CASE") and contain at least 4 characters
|
|
578
608
|
selector: 'objectLiteralProperty',
|
|
579
609
|
filter: '^[^_]{4,}$',
|
|
580
610
|
format: null
|
|
@@ -644,6 +674,7 @@ module.exports = {
|
|
|
644
674
|
/* ['error', {
|
|
645
675
|
ignore: [-3, -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 15, 16, 24, 32, 60, 63, 64, 100, 128, 250, 255, 256, 500, 1000, 4_294_967_296],
|
|
646
676
|
ignoreArrayIndexes: true,
|
|
677
|
+
ignoreClassFieldInitialValues: true,
|
|
647
678
|
enforceConst: true,
|
|
648
679
|
detectObjects: true
|
|
649
680
|
}], */
|
|
@@ -762,19 +793,20 @@ module.exports = {
|
|
|
762
793
|
*
|
|
763
794
|
* @see https://github.com/import-js/eslint-plugin-import
|
|
764
795
|
*/
|
|
796
|
+
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
|
|
765
797
|
'import/default': 'error',
|
|
766
798
|
'import/dynamic-import-chunkname': ['off', { // Here an "ignore" option is missing, which allows to ignore "@json\/locales\/.+?\.json", because these are handled in the webpack configuration.
|
|
767
799
|
webpackChunknameFormat: '[0-9a-zA-Z-_/.+]+'
|
|
768
800
|
}],
|
|
769
801
|
'import/export': 'error',
|
|
770
802
|
'import/exports-last': 'off', // Exports should be declared first; helper functions last
|
|
771
|
-
'import/extensions': 'off', // There is no check that it's really an extension or part of the file name.
|
|
803
|
+
'import/extensions': 'off', // There is no check that it's really an extension or part of the file name. Misinterprets 'JavaDateTime' as extension in 'DateTime.JavaDateTime' for 'DateTime.DOSDateTime.ts'. So, we disable this rule
|
|
772
804
|
'import/first': 'error',
|
|
773
805
|
'import/group-exports': 'off',
|
|
774
806
|
'import/max-dependencies': ['error', { max: 20, ignoreTypeImports: true }],
|
|
775
807
|
'import/named': 'error',
|
|
776
808
|
'import/namespace': ['error', { allowComputed: true }],
|
|
777
|
-
'import/newline-after-import': 'error',
|
|
809
|
+
'import/newline-after-import': ['error', { considerComments: true }],
|
|
778
810
|
'import/no-absolute-path': 'error',
|
|
779
811
|
'import/no-amd': 'error',
|
|
780
812
|
'import/no-anonymous-default-export': 'error',
|
|
@@ -784,6 +816,7 @@ module.exports = {
|
|
|
784
816
|
'import/no-deprecated': 'error',
|
|
785
817
|
'import/no-duplicates': 'error',
|
|
786
818
|
'import/no-dynamic-require': 'error',
|
|
819
|
+
'import/no-empty-named-blocks': 'error',
|
|
787
820
|
'import/no-extraneous-dependencies': 'error',
|
|
788
821
|
'import/no-internal-modules': ['off', { // @todo Throws an "Cannot read property 'value' of null" error in src/help/scss/help.scss.d.ts:2 since the update to v2.21.1. If this issue does not get fixed in the next releases, report it!
|
|
789
822
|
allow: [
|
|
@@ -813,7 +846,7 @@ module.exports = {
|
|
|
813
846
|
'import/no-useless-path-segments': 'error',
|
|
814
847
|
'import/no-webpack-loader-syntax': 'off', // Indeed, you should avoid that, but if we do it, we have a reason for it
|
|
815
848
|
'import/order': ['error', {
|
|
816
|
-
'alphabetize': { order: 'asc', caseInsensitive: true },
|
|
849
|
+
'alphabetize': { order: 'asc', orderImportKind: 'asc', caseInsensitive: true },
|
|
817
850
|
'groups': ['builtin', 'unknown', 'external', 'internal', 'parent', 'sibling', 'index'],
|
|
818
851
|
'newlines-between': 'always',
|
|
819
852
|
'pathGroupsExcludedImportTypes': [],
|
|
@@ -830,7 +863,8 @@ module.exports = {
|
|
|
830
863
|
{ pattern: '@*', group: 'internal' },
|
|
831
864
|
{ pattern: '@*/**', group: 'internal' },
|
|
832
865
|
{ pattern: '*!*/**', group: 'internal', position: 'after' } // Webpack loaders, e.g. 'worker-ref-loader!@app/components/FileFormatIdentificationDialog/TypeDetection.worker'
|
|
833
|
-
]
|
|
866
|
+
],
|
|
867
|
+
'distinctGroup': false
|
|
834
868
|
}],
|
|
835
869
|
'import/prefer-default-export': 'off',
|
|
836
870
|
'import/unambiguous': 'off',
|
|
@@ -912,6 +946,7 @@ module.exports = {
|
|
|
912
946
|
'unicorn/no-instanceof-array': 'error',
|
|
913
947
|
'unicorn/no-keyword-prefix': 'off',
|
|
914
948
|
'unicorn/no-lonely-if': 'off', // Sometimes the code is clearer if-conditions are not combined
|
|
949
|
+
'unicorn/no-negated-condition': 'off',
|
|
915
950
|
'unicorn/no-nested-ternary': 'off', // We prefer no-nested-ternary of ESlint
|
|
916
951
|
'unicorn/no-new-array': 'off', // `new Array(length)` should be preferred over `Array.from({ length })` because it's much faster. @see https://jsben.ch/qTpYp
|
|
917
952
|
'unicorn/no-new-buffer': 'error',
|
|
@@ -921,6 +956,7 @@ module.exports = {
|
|
|
921
956
|
'unicorn/no-static-only-class': 'error',
|
|
922
957
|
'unicorn/no-thenable': 'error',
|
|
923
958
|
'unicorn/no-this-assignment': 'error',
|
|
959
|
+
'unicorn/no-typeof-undefined': 'error',
|
|
924
960
|
'unicorn/no-unnecessary-await': 'error',
|
|
925
961
|
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
926
962
|
'unicorn/no-unreadable-iife': 'error',
|
|
@@ -970,8 +1006,9 @@ module.exports = {
|
|
|
970
1006
|
'unicorn/prefer-query-selector': 'off', // document.getElementById() is much faster
|
|
971
1007
|
'unicorn/prefer-reflect-apply': 'error',
|
|
972
1008
|
'unicorn/prefer-set-has': 'error',
|
|
1009
|
+
'unicorn/prefer-set-size': 'error',
|
|
973
1010
|
'unicorn/prefer-spread': 'off', // @todo Disabled till there a solution for the warning, that `slice()` on Typed-Arrays should be replaced (which is not possible). @see https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1064
|
|
974
|
-
'unicorn/prefer-string-replace-all': 'off',
|
|
1011
|
+
'unicorn/prefer-string-replace-all': 'off', // @todo Available since 2020 in browsers. SHould this be preferred?
|
|
975
1012
|
'unicorn/prefer-string-slice': 'off', // @todo As of today (2020.08.24) and since the last 9 years, substr() is three times faster than slice() in Firefox.
|
|
976
1013
|
'unicorn/prefer-string-starts-ends-with': 'error',
|
|
977
1014
|
'unicorn/prefer-string-trim-start-end': 'error',
|
package/eslint/overrides-jest.js
CHANGED
|
@@ -2,6 +2,22 @@
|
|
|
2
2
|
* @file Settings for Jest based unit tests.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
const jestVersion = (() => {
|
|
6
|
+
try {
|
|
7
|
+
// eslint-disable-next-line n/no-missing-require, import/no-dynamic-require -- If "overrides-jest" is used, "jest" should be installed, and it should be searched in the working directory of the process.
|
|
8
|
+
const version = require(require.resolve('jest', { paths: [process.cwd()] })).getVersion().split('.')[0];
|
|
9
|
+
|
|
10
|
+
process.stdout.write(`Detected Jest version: ${version}\n\n`);
|
|
11
|
+
|
|
12
|
+
return version;
|
|
13
|
+
}
|
|
14
|
+
catch {
|
|
15
|
+
process.stderr.write('No Jest version detected\n\n');
|
|
16
|
+
|
|
17
|
+
return 'detect';
|
|
18
|
+
}
|
|
19
|
+
})();
|
|
20
|
+
|
|
5
21
|
module.exports = {
|
|
6
22
|
overrides: [
|
|
7
23
|
{
|
|
@@ -11,21 +27,7 @@ module.exports = {
|
|
|
11
27
|
},
|
|
12
28
|
settings: {
|
|
13
29
|
jest: {
|
|
14
|
-
version:
|
|
15
|
-
try {
|
|
16
|
-
// eslint-disable-next-line n/no-missing-require, import/no-dynamic-require -- If "overrides-jest" is used, "jest" should be installed, and it should be searched in the working directory of the process.
|
|
17
|
-
const jestVersion = require(require.resolve('jest', { paths: [process.cwd()] })).getVersion().split('.')[0];
|
|
18
|
-
|
|
19
|
-
process.stdout.write(`Detected Jest version: ${jestVersion}\n\n`);
|
|
20
|
-
|
|
21
|
-
return jestVersion;
|
|
22
|
-
}
|
|
23
|
-
catch {
|
|
24
|
-
process.stderr.write('No Jest version detected\n\n');
|
|
25
|
-
|
|
26
|
-
return 'detect';
|
|
27
|
-
}
|
|
28
|
-
})()
|
|
30
|
+
version: jestVersion
|
|
29
31
|
}
|
|
30
32
|
},
|
|
31
33
|
plugins: ['jest'],
|
|
@@ -116,6 +118,26 @@ module.exports = {
|
|
|
116
118
|
'jest/valid-expect': 'error',
|
|
117
119
|
'jest/valid-title': 'error'
|
|
118
120
|
}
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
files: ['**/__tests__/**/*.ts', '**/?(*.)+(spec|test).ts'],
|
|
124
|
+
env: {
|
|
125
|
+
jest: true
|
|
126
|
+
},
|
|
127
|
+
settings: {
|
|
128
|
+
jest: {
|
|
129
|
+
version: jestVersion
|
|
130
|
+
}
|
|
131
|
+
},
|
|
132
|
+
plugins: ['jest'],
|
|
133
|
+
rules: {
|
|
134
|
+
/**
|
|
135
|
+
* eslint-plugin-jest
|
|
136
|
+
*
|
|
137
|
+
* @see https://github.com/jest-community/eslint-plugin-jest/tree/master/docs/rules
|
|
138
|
+
*/
|
|
139
|
+
'jest/no-untyped-mock-factory': 'error'
|
|
140
|
+
}
|
|
119
141
|
}
|
|
120
142
|
]
|
|
121
143
|
};
|
|
@@ -13,7 +13,8 @@ module.exports = {
|
|
|
13
13
|
plugins: ['jsdoc'],
|
|
14
14
|
settings: {
|
|
15
15
|
jsdoc: {
|
|
16
|
-
mode: 'typescript'
|
|
16
|
+
mode: 'typescript',
|
|
17
|
+
exemptDestructuredRootsFromChecks: true
|
|
17
18
|
}
|
|
18
19
|
},
|
|
19
20
|
rules: {
|
|
@@ -75,6 +76,7 @@ module.exports = {
|
|
|
75
76
|
},
|
|
76
77
|
noEndLines: true
|
|
77
78
|
}],
|
|
79
|
+
'jsdoc/text-escaping': 'off', // Right now, there is no description of this rule available on the page. Only the discussion here: https://github.com/gajus/eslint-plugin-jsdoc/issues/864
|
|
78
80
|
'jsdoc/valid-types': 'off' // Checked by TypeScript
|
|
79
81
|
}
|
|
80
82
|
}
|
|
@@ -35,6 +35,7 @@ module.exports = {
|
|
|
35
35
|
* @see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y
|
|
36
36
|
*/
|
|
37
37
|
'jsx-a11y/alt-text': 'error',
|
|
38
|
+
'jsx-a11y/anchor-ambiguous-text': 'off',
|
|
38
39
|
'jsx-a11y/anchor-has-content': 'error',
|
|
39
40
|
'jsx-a11y/anchor-is-valid': 'error',
|
|
40
41
|
'jsx-a11y/aria-activedescendant-has-tabindex': 'error',
|
|
@@ -53,6 +54,7 @@ module.exports = {
|
|
|
53
54
|
'jsx-a11y/media-has-caption': 'error',
|
|
54
55
|
'jsx-a11y/mouse-events-have-key-events': 'error',
|
|
55
56
|
'jsx-a11y/no-access-key': 'off', // If you explicitly specify an access key, you usually have a reason for this, so it should not be prevented by a rule
|
|
57
|
+
'jsx-a11y/no-aria-hidden-on-focusable': 'error',
|
|
56
58
|
'jsx-a11y/no-autofocus': ['error', { ignoreNonDOM: true }],
|
|
57
59
|
'jsx-a11y/no-distracting-elements': 'error',
|
|
58
60
|
'jsx-a11y/no-interactive-element-to-noninteractive-role': 'error',
|
|
@@ -103,9 +105,9 @@ module.exports = {
|
|
|
103
105
|
namedComponents: 'arrow-function',
|
|
104
106
|
unnamedComponents: 'arrow-function'
|
|
105
107
|
}],
|
|
106
|
-
'react/hook-use-state':
|
|
108
|
+
'react/hook-use-state': ['error', { allowDestructuredState: true }],
|
|
107
109
|
'react/jsx-boolean-value': ['error', 'always'],
|
|
108
|
-
'react/jsx-child-element-spacing': 'off', // @todo Why is this disabled? Could it be, that the faulty
|
|
110
|
+
'react/jsx-child-element-spacing': 'off', // @todo Why is this disabled? Could it be, that the faulty behavior is fixed in the meantime?
|
|
109
111
|
'react/jsx-closing-bracket-location': 'error',
|
|
110
112
|
'react/jsx-closing-tag-location': 'error',
|
|
111
113
|
'react/jsx-curly-brace-presence': ['error', { propElementValues: 'always' }],
|
|
@@ -164,7 +166,7 @@ module.exports = {
|
|
|
164
166
|
'react/no-is-mounted': 'error',
|
|
165
167
|
'react/no-multi-comp': 'error',
|
|
166
168
|
'react/no-namespace': 'error',
|
|
167
|
-
|
|
169
|
+
'react/no-object-type-as-default-prop': 'error',
|
|
168
170
|
'react/no-redundant-should-component-update': 'error',
|
|
169
171
|
'react/no-render-return-value': 'error',
|
|
170
172
|
'react/no-set-state': 'off',
|
|
@@ -185,7 +187,7 @@ module.exports = {
|
|
|
185
187
|
'react/prefer-stateless-function': 'error',
|
|
186
188
|
'react/prop-types': 'off',
|
|
187
189
|
'react/react-in-jsx-scope': 'error',
|
|
188
|
-
'react/require-default-props': ['off', { forbidDefaultForRequired: true, ignoreFunctionalComponents: true }], // @see https://medium.com/@matanbobi/react-defaultprops-is-dying-whos-the-contender-443c19d9e7f1 @todo Also disabled
|
|
190
|
+
'react/require-default-props': ['off', { forbidDefaultForRequired: true, ignoreFunctionalComponents: true }], // @see https://medium.com/@matanbobi/react-defaultprops-is-dying-whos-the-contender-443c19d9e7f1 @todo Also disabled because of false-positive with React.forwardRef(), create bug report?
|
|
189
191
|
'react/require-optimization': 'error',
|
|
190
192
|
'react/require-render-return': 'error',
|
|
191
193
|
'react/self-closing-comp': 'error',
|
|
@@ -205,7 +207,7 @@ module.exports = {
|
|
|
205
207
|
'static-methods'
|
|
206
208
|
]
|
|
207
209
|
}],
|
|
208
|
-
'react/
|
|
210
|
+
'react/sort-default-props': 'error',
|
|
209
211
|
'react/sort-prop-types': 'error',
|
|
210
212
|
'react/state-in-constructor': 'error',
|
|
211
213
|
'react/static-property-placement': 'error',
|
package/helper/ensure-type.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @returns {T extends Array<any> ? T : []} Either the input array, or an empty array, if the input array is not an array.
|
|
11
11
|
*/
|
|
12
12
|
function array (value) {
|
|
13
|
-
// @ts-expect-error -- Right now the type
|
|
13
|
+
// @ts-expect-error -- Right now the type definition of `Array.isArray()` is incorrect since it uses `arg is any[]` instead of the correct type of `arg`.
|
|
14
14
|
return (Array.isArray(value) ? value : []);
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -21,20 +21,20 @@ function findMissingOverrides () {
|
|
|
21
21
|
const result = [];
|
|
22
22
|
|
|
23
23
|
for (const [name, expectedVersion] of Object.entries(linterBundleDependencies)) {
|
|
24
|
-
let
|
|
24
|
+
let dependencyPackageJson;
|
|
25
25
|
|
|
26
26
|
try {
|
|
27
|
-
|
|
27
|
+
dependencyPackageJson = JSON.parse(fs.readFileSync(path.join(process.cwd(), 'node_modules', name, 'package.json'), 'utf8'));
|
|
28
28
|
}
|
|
29
29
|
catch {
|
|
30
30
|
// If the file does not exist, we ignore it, because in this case it's most likely a linter-bundle-only dependency.
|
|
31
31
|
continue;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
-
if (
|
|
34
|
+
if (dependencyPackageJson.version !== expectedVersion) {
|
|
35
35
|
result.push({
|
|
36
36
|
name,
|
|
37
|
-
configuredVersion:
|
|
37
|
+
configuredVersion: dependencyPackageJson.version,
|
|
38
38
|
expectedVersion
|
|
39
39
|
});
|
|
40
40
|
}
|
package/helper/is-npm-or-yarn.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Check if the project is using npm or yarn by checking the
|
|
2
|
+
* @file Check if the project is using npm or yarn by checking the existence of a `package-lock.json` or a `yarn.lock`.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
5
|
const fs = require('fs');
|
package/lint.js
CHANGED
|
@@ -38,11 +38,11 @@ void (async () => {
|
|
|
38
38
|
if (config['git']) {
|
|
39
39
|
if (!gitFilesProcessPromise) {
|
|
40
40
|
gitFilesProcessPromise = {
|
|
41
|
-
// Returns changed files, also stashed and
|
|
41
|
+
// Returns changed files, also stashed and committed
|
|
42
42
|
diff: runProcess('git diff --name-only -z @{upstream}'),
|
|
43
43
|
// Returns unstashed files (including deleted)
|
|
44
44
|
modified: runProcess('git ls-files -o -m --exclude-standard --full-name --deduplicate -z'),
|
|
45
|
-
// Returns unstashed, deleted files - @todo Is there a way to also get a list of deleted stashed/
|
|
45
|
+
// Returns unstashed, deleted files - @todo Is there a way to also get a list of deleted stashed/committed files?
|
|
46
46
|
deleted: runProcess('git ls-files -d --exclude-standard --full-name --deduplicate -z')
|
|
47
47
|
};
|
|
48
48
|
}
|
|
@@ -378,7 +378,7 @@ function getIncludes (list, pattern, config) {
|
|
|
378
378
|
}
|
|
379
379
|
|
|
380
380
|
/**
|
|
381
|
-
*
|
|
381
|
+
* Executes a task asynchronously.
|
|
382
382
|
*
|
|
383
383
|
* @param {TaskSetup} setup - The task execution setup.
|
|
384
384
|
* @returns {Job} Job
|
|
@@ -395,7 +395,7 @@ function runTask (setup) {
|
|
|
395
395
|
* Returns a job configuration which does not run any task, but just returns the given `output`.
|
|
396
396
|
*
|
|
397
397
|
* @param {string} taskName - The name of the task.
|
|
398
|
-
* @param {Partial<Record<string, (string | true)[]>>} config - The
|
|
398
|
+
* @param {Partial<Record<string, (string | true)[]>>} config - The configuration of the task.
|
|
399
399
|
* @param {{ code?: number; stdout?: string; stderr?: string; }} output - The output which should be returned as result of the job.
|
|
400
400
|
* @returns {Job} Job
|
|
401
401
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linter-bundle",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.27.0",
|
|
4
4
|
"description": "Ready-to use bundle of linting tools, containing configurations for ESLint, stylelint and markdownlint.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"eslint",
|
|
@@ -40,29 +40,29 @@
|
|
|
40
40
|
"check-outdated": "npx --yes -- check-outdated --ignore-pre-releases"
|
|
41
41
|
},
|
|
42
42
|
"dependencies": {
|
|
43
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
44
|
-
"@typescript-eslint/parser": "5.
|
|
45
|
-
"@typescript-eslint/utils": "5.
|
|
46
|
-
"eslint": "8.
|
|
47
|
-
"eslint-import-resolver-typescript": "3.5.
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "5.49.0",
|
|
44
|
+
"@typescript-eslint/parser": "5.49.0",
|
|
45
|
+
"@typescript-eslint/utils": "5.49.0",
|
|
46
|
+
"eslint": "8.32.0",
|
|
47
|
+
"eslint-import-resolver-typescript": "3.5.3",
|
|
48
48
|
"eslint-import-resolver-webpack": "0.13.2",
|
|
49
49
|
"eslint-plugin-eslint-comments": "3.2.0",
|
|
50
50
|
"eslint-plugin-functional": "4.4.1",
|
|
51
|
-
"eslint-plugin-import": "2.
|
|
52
|
-
"eslint-plugin-jest": "27.1
|
|
53
|
-
"eslint-plugin-jsdoc": "39.
|
|
54
|
-
"eslint-plugin-jsx-a11y": "6.
|
|
55
|
-
"eslint-plugin-n": "15.
|
|
51
|
+
"eslint-plugin-import": "2.27.5",
|
|
52
|
+
"eslint-plugin-jest": "27.2.1",
|
|
53
|
+
"eslint-plugin-jsdoc": "39.6.9",
|
|
54
|
+
"eslint-plugin-jsx-a11y": "6.7.1",
|
|
55
|
+
"eslint-plugin-n": "15.6.1",
|
|
56
56
|
"eslint-plugin-promise": "6.1.1",
|
|
57
|
-
"eslint-plugin-react": "7.
|
|
57
|
+
"eslint-plugin-react": "7.32.1",
|
|
58
58
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
59
|
-
"eslint-plugin-unicorn": "
|
|
60
|
-
"markdownlint-cli": "0.
|
|
59
|
+
"eslint-plugin-unicorn": "45.0.2",
|
|
60
|
+
"markdownlint-cli": "0.33.0",
|
|
61
61
|
"micromatch": "4.0.5",
|
|
62
|
-
"postcss-scss": "4.0.
|
|
63
|
-
"stylelint": "14.
|
|
62
|
+
"postcss-scss": "4.0.6",
|
|
63
|
+
"stylelint": "14.16.1",
|
|
64
64
|
"stylelint-declaration-block-no-ignored-properties": "2.6.0",
|
|
65
|
-
"stylelint-order": "
|
|
65
|
+
"stylelint-order": "6.0.1",
|
|
66
66
|
"stylelint-scss": "4.3.0",
|
|
67
67
|
"stylelint-selector-no-empty": "1.0.9",
|
|
68
68
|
"stylelint-use-logical-spec": "4.1.0"
|
|
@@ -72,10 +72,10 @@
|
|
|
72
72
|
"typescript": "^4.0.0"
|
|
73
73
|
},
|
|
74
74
|
"devDependencies": {
|
|
75
|
-
"@types/eslint": "8.4.
|
|
75
|
+
"@types/eslint": "8.4.10",
|
|
76
76
|
"@types/micromatch": "4.0.2",
|
|
77
|
-
"@types/node": "18.11.
|
|
77
|
+
"@types/node": "18.11.18",
|
|
78
78
|
"stylelint-find-new-rules": "4.0.0",
|
|
79
|
-
"typescript": "4.
|
|
79
|
+
"typescript": "4.9.4"
|
|
80
80
|
}
|
|
81
81
|
}
|
package/stylelint/index.js
CHANGED
|
@@ -214,6 +214,7 @@ module.exports = {
|
|
|
214
214
|
'media-feature-name-no-vendor-prefix': null, // For Safari, we still need "-webkit-min-device-pixel-ratio": https://caniuse.com/css-media-resolution
|
|
215
215
|
'media-feature-name-value-allowed-list': null,
|
|
216
216
|
'media-feature-parentheses-space-inside': 'never',
|
|
217
|
+
'media-feature-range-notation': 'prefix',
|
|
217
218
|
'media-feature-range-operator-space-after': 'always',
|
|
218
219
|
'media-feature-range-operator-space-before': 'always',
|
|
219
220
|
'media-query-list-comma-newline-after': 'always-multi-line',
|
package/types.d.ts
CHANGED
|
@@ -19,13 +19,13 @@ declare namespace globalThis {
|
|
|
19
19
|
readonly overrides?: {
|
|
20
20
|
readonly general?: {
|
|
21
21
|
readonly 'no-restricted-globals'?: {
|
|
22
|
-
readonly
|
|
22
|
+
readonly additionalRestrictions?: string[];
|
|
23
23
|
};
|
|
24
24
|
readonly 'no-restricted-properties'?: {
|
|
25
|
-
readonly
|
|
25
|
+
readonly additionalRestrictions?: string[];
|
|
26
26
|
};
|
|
27
27
|
readonly 'no-restricted-syntax'?: {
|
|
28
|
-
readonly
|
|
28
|
+
readonly additionalRestrictions?: string[];
|
|
29
29
|
};
|
|
30
30
|
readonly 'import/order'?: {
|
|
31
31
|
readonly additionalExternalPatterns?: string[];
|