linter-bundle 2.11.0 → 2.13.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 CHANGED
@@ -6,9 +6,65 @@ 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.11.0...HEAD)
9
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.13.0...HEAD)
10
10
 
11
- ## [2.11.0] - 2020.03.12
11
+ ## [2.13.0] - 2022.04.25
12
+
13
+ ### Changed
14
+
15
+ - [eslint] Activate `allowExpressions` option of [`@typescript-eslint/explicit-function-return-type`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md) rule
16
+ - [eslint] Updated `@typescript-eslint` from `5.17.0` to `5.21.0`
17
+ - [eslint] Updated `eslint` from `8.12.0` to `8.14.0`
18
+ - [eslint] Updated `eslint-import-resolver-typescript` from `2.7.0` to `2.7.1`
19
+ - [eslint] Updated `eslint-plugin-functional` from `4.2.0` to `4.2.1`
20
+ - [eslint] Updated `eslint-plugin-import` from `2.25.4` to `2.26.0`
21
+ - [eslint] Updated `eslint-plugin-jest` from `26.1.3` to `26.1.5`
22
+ - [eslint] Updated `eslint-plugin-jsdoc` from `38.1.4` to `39.2.8`
23
+ - [eslint] Updated `eslint-plugin-unicorn` from `41.0.1` to `42.0.0`
24
+ - [stylelint] Updated `postcss-scss` from `4.0.3` to `4.0.4`
25
+ - [stylelint] Updated `stylelint` from `14.6.1` to `14.7.1`
26
+ - [eslint] Activate `allowExpressions` option of [`@typescript-eslint/explicit-function-return-type`](https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/explicit-function-return-type.md) rule
27
+ - [eslint/overrides-jsdoc] Set [`minLineCount` option to 2](https://github.com/gajus/eslint-plugin-jsdoc/issues/870) for `require-jsdoc` rule
28
+ - [eslint] Reactivated the [`import/no-relative-packages`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-relative-packages.md) rule
29
+ - [eslint] Make use of [`unicorn/no-useless-switch-case`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-useless-switch-case.md) rule
30
+ - [eslint] Make use of [`unicorn/prefer-modern-math-apis`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-modern-math-apis.md) rule
31
+ - [eslint] Make use of [`unicorn/no-unreadable-iife`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unreadable-iife.md) rule
32
+ - [eslint] Add but disable [`unicorn/prefer-native-coercion-functions`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-native-coercion-functions.md) rule, because this would produce inconsistency in the code and is harder to read
33
+ - [stylelint] Set new [`selector-not-notation`](https://github.com/stylelint/stylelint/blob/main/lib/rules/selector-not-notation/README.md) rule to `"complex"`
34
+
35
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.12.0...v2.13.0)
36
+
37
+ ## [2.12.0] - 2022.03.30
38
+
39
+ ### Changed
40
+
41
+ - [eslint] Updated `@typescript-eslint` from `5.14.0` to `5.17.0`
42
+ - [eslint] Updated `eslint` from `8.11.0` to `8.12.0`
43
+ - [eslint] Updated `eslint-import-resolver-typescript` from `2.5.0` to `2.7.0`
44
+ - [eslint] Updated `eslint-plugin-jest` from `26.1.1` to `26.1.3`
45
+ - [eslint] Updated `eslint-plugin-jsdoc` from `38.0.2` to `38.1.4`
46
+ - [eslint] Updated `eslint-plugin-react` from `7.29.3` to `7.29.4`
47
+ - [eslint] Updated `eslint-plugin-react-hooks` from `4.3.0` to `4.4.0`
48
+ - [eslint] Updated `eslint-plugin-unicorn` from `41.0.0` to `41.0.1`
49
+ - [stylelint] Updated `stylelint` from `14.5.3` to `14.6.1`
50
+ - [stylelint] Updated `stylelint-scss` from `4.1.0` to `4.2.0`
51
+ - Updated `micromatch` from `4.0.4` to `4.0.5`
52
+ - [eslint] Make use of [`destructuredArrayIgnorePattern`](https://eslint.org/docs/rules/no-unused-vars#destructuredarrayignorepattern) of `@typescript-eslint/no-unused-vars` rule, to ignore variables with leading underscore.
53
+ - [stylelint] Make use of [`declaration-property-max-values`](https://stylelint.io/user-guide/rules/list/declaration-property-max-values/) rule, and set `unprefixed-property-name` to `4`
54
+ - [stylelint] Replace `function-no-unknown` by `scss/function-no-unknown`
55
+
56
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.11.1...v2.12.0)
57
+
58
+ ## [2.11.1] - 2022.03.13
59
+
60
+ ### Changed
61
+
62
+ - [eslint] Disabled `@typescript-eslint/no-redundant-type-constituents`, because of false positives with `Promise<... | never>`
63
+ - [eslint] Weaken `@typescript-eslint/naming-convention` rule to allow names with special characters for `objectLiteralProperty`.
64
+
65
+ [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.11.0...v2.11.1)
66
+
67
+ ## [2.11.0] - 2022.03.12
12
68
 
13
69
  ### Added
14
70
 
@@ -18,12 +74,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
18
74
  ### Changed
19
75
 
20
76
  - [eslint] Updated `eslint` from `8.10.0` to `8.11.0`
21
- - [eslint] Update `eslint-plugin-jsdoc` from `37.9.7` to `38.0.2`
77
+ - [eslint] Updated `eslint-plugin-jsdoc` from `37.9.7` to `38.0.2`
22
78
  - [eslint] Disabled [`unicorn/prefer-json-parse-buffer`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-json-parse-buffer.md) rule, as [TypeScript states](https://github.com/microsoft/TypeScript/issues/11842) that string needs to be used as of the ES specification.
23
79
 
24
80
  [Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v2.10.1...v2.11.0)
25
81
 
26
- ## [2.10.1] - 2020.03.11
82
+ ## [2.10.1] - 2022.03.11
27
83
 
28
84
  ### Fixed
29
85
 
package/README.md CHANGED
@@ -168,7 +168,7 @@ module.exports = {
168
168
  Source | Description | Rules setup
169
169
  -|-|-
170
170
  `linter-bundle/eslint` | General rule setup. This is also the base for the following **overrides**. | [View](./eslint/index.js)
171
- `linter-bundle/eslint/overrides-gatsby` | Settings for Gatsby-based projects. | [View](./eslint/overrides-gatsby)
171
+ `linter-bundle/eslint/overrides-gatsby` | Settings for Gatsby-based projects. | [View](./eslint/overrides-gatsby.js)
172
172
  `linter-bundle/eslint/overrides-javascript` | Strict settings for JavaScript files, which enforces correct types everywhere. | [View](./eslint/overrides-javascript.js)
173
173
  `linter-bundle/eslint/overrides-javascript-lazy` | Can be used instead of `overrides-javascript`. It's less strict and allows the `any` type. | [View](./eslint/overrides-javascript-lazy.js)
174
174
  `linter-bundle/eslint/overrides-jest` | Settings for projects using Jest. | [View](./eslint/overrides-jest.js)
package/eslint/index.js CHANGED
@@ -426,7 +426,7 @@ module.exports = {
426
426
  '@typescript-eslint/consistent-type-exports': 'error',
427
427
  '@typescript-eslint/consistent-type-imports': ['error', { disallowTypeAnnotations: false }],
428
428
  '@typescript-eslint/dot-notation': 'error',
429
- '@typescript-eslint/explicit-function-return-type': 'error',
429
+ '@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
430
430
  '@typescript-eslint/explicit-member-accessibility': ['error', {
431
431
  ignoredMethodNames: [
432
432
  'constructor',
@@ -561,10 +561,29 @@ module.exports = {
561
561
  },
562
562
  {
563
563
  selector: 'objectLiteralProperty',
564
+ // `__html` is a property of React's `dangerouslySetInnerHTML` object
564
565
  filter: '^__html$',
565
566
  types: ['string'],
566
567
  format: null
567
568
  },
569
+ {
570
+ // Allow properties which only contain digits
571
+ selector: 'objectLiteralProperty',
572
+ filter: '^\\d+$',
573
+ format: null
574
+ },
575
+ {
576
+ // Allow empty or one-character properties
577
+ selector: 'objectLiteralProperty',
578
+ filter: '^.?$',
579
+ format: null
580
+ },
581
+ {
582
+ // Allow properties which which don't contain an underscore (to prevent usage of "UPPER_CASE") and contain atleast 4 characters
583
+ selector: 'objectLiteralProperty',
584
+ filter: '^[^_]{4,}$',
585
+ format: null
586
+ },
568
587
  { selector: 'typeProperty', format: ['camelCase', 'PascalCase'] },
569
588
  {
570
589
  selector: 'typeProperty',
@@ -641,7 +660,7 @@ module.exports = {
641
660
  '@typescript-eslint/no-non-null-asserted-optional-chain': 'error',
642
661
  '@typescript-eslint/no-parameter-properties': 'error',
643
662
  '@typescript-eslint/no-redeclare': ['error', { ignoreDeclarationMerge: true }],
644
- '@typescript-eslint/no-redundant-type-constituents': 'error',
663
+ '@typescript-eslint/no-redundant-type-constituents': 'off', // False positive with Promise<... | never>
645
664
  '@typescript-eslint/no-require-imports': 'error',
646
665
  '@typescript-eslint/no-shadow': 'error',
647
666
  '@typescript-eslint/no-this-alias': 'error',
@@ -670,7 +689,7 @@ module.exports = {
670
689
  '@typescript-eslint/no-unsafe-member-access': 'error',
671
690
  '@typescript-eslint/no-unsafe-return': 'error',
672
691
  '@typescript-eslint/no-unused-expressions': 'error',
673
- '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
692
+ '@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' }],
674
693
  '@typescript-eslint/no-use-before-define': ['error', { functions: false }],
675
694
  '@typescript-eslint/no-useless-constructor': 'error',
676
695
  '@typescript-eslint/no-var-requires': 'error',
@@ -781,7 +800,7 @@ module.exports = {
781
800
  'import/no-named-export': 'off',
782
801
  'import/no-namespace': 'off', // @todo Enabling this produces a JavaScript error in the rule; anyhow - could that reduce the package size, because of improved tree-shaking/dead-code-elimination?
783
802
  'import/no-nodejs-modules': 'error',
784
- // 'import/no-relative-packages': 'error', -- Removed because of roll-back of eslint-plugin-import in version 1.18.0
803
+ 'import/no-relative-packages': 'error',
785
804
  'import/no-relative-parent-imports': 'off', // @todo Disabled because of a bug on Windows, re-enable as soon as it's resolved: https://github.com/import-js/eslint-plugin-import/issues/1644
786
805
  'import/no-restricted-paths': 'error',
787
806
  'import/no-self-import': 'error',
@@ -942,6 +961,7 @@ module.exports = {
942
961
  'unicorn/no-thenable': 'error',
943
962
  'unicorn/no-this-assignment': 'error',
944
963
  'unicorn/no-unreadable-array-destructuring': 'error',
964
+ 'unicorn/no-unreadable-iife': 'error',
945
965
  'unicorn/no-unsafe-regex': 'off',
946
966
  'unicorn/no-unused-properties': 'error',
947
967
  'unicorn/no-useless-fallback-in-spread': 'error',
@@ -949,6 +969,7 @@ module.exports = {
949
969
  'unicorn/no-invalid-remove-event-listener': 'error',
950
970
  'unicorn/no-useless-length-check': 'error',
951
971
  'unicorn/no-useless-spread': 'error',
972
+ 'unicorn/no-useless-switch-case': 'error',
952
973
  'unicorn/no-useless-undefined': ['error', { checkArguments: false }],
953
974
  'unicorn/no-zero-fractions': 'error',
954
975
  'unicorn/number-literal-case': 'error',
@@ -973,7 +994,9 @@ module.exports = {
973
994
  'unicorn/prefer-keyboard-event-key': 'error',
974
995
  'unicorn/prefer-math-trunc': 'error',
975
996
  'unicorn/prefer-modern-dom-apis': 'error',
997
+ 'unicorn/prefer-modern-math-apis': 'error',
976
998
  'unicorn/prefer-module': 'off',
999
+ 'unicorn/prefer-native-coercion-functions': 'off',
977
1000
  'unicorn/prefer-negative-index': 'error',
978
1001
  'unicorn/prefer-number-properties': 'error',
979
1002
  'unicorn/prefer-object-has-own': 'off', // Not widely supported yet. Can be activated in 2024
@@ -50,7 +50,7 @@ module.exports = {
50
50
  'jsdoc/require-example': 'off',
51
51
  'jsdoc/require-file-overview': 'error',
52
52
  'jsdoc/require-hyphen-before-param-description': 'error',
53
- 'jsdoc/require-jsdoc': 'error',
53
+ 'jsdoc/require-jsdoc': ['error', { minLineCount: 2 }],
54
54
  'jsdoc/require-param-description': 'error',
55
55
  'jsdoc/require-param-name': 'error',
56
56
  'jsdoc/require-param-type': 'error',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "linter-bundle",
3
- "version": "2.11.0",
3
+ "version": "2.13.0",
4
4
  "description": "Ready-to use bundle of linting tools, containing configurations for ESLint, stylelint and markdownlint.",
5
5
  "keywords": [
6
6
  "eslint",
@@ -39,29 +39,29 @@
39
39
  "check-outdated": "npx --yes -- check-outdated --ignore-pre-releases"
40
40
  },
41
41
  "dependencies": {
42
- "@typescript-eslint/eslint-plugin": "5.14.0",
43
- "@typescript-eslint/parser": "5.14.0",
44
- "eslint": "8.11.0",
45
- "eslint-import-resolver-typescript": "2.5.0",
42
+ "@typescript-eslint/eslint-plugin": "5.21.0",
43
+ "@typescript-eslint/parser": "5.21.0",
44
+ "eslint": "8.14.0",
45
+ "eslint-import-resolver-typescript": "2.7.1",
46
46
  "eslint-import-resolver-webpack": "0.13.2",
47
47
  "eslint-plugin-eslint-comments": "3.2.0",
48
- "eslint-plugin-functional": "4.2.0",
49
- "eslint-plugin-import": "2.25.4",
50
- "eslint-plugin-jest": "26.1.1",
51
- "eslint-plugin-jsdoc": "38.0.2",
48
+ "eslint-plugin-functional": "4.2.1",
49
+ "eslint-plugin-import": "2.26.0",
50
+ "eslint-plugin-jest": "26.1.5",
51
+ "eslint-plugin-jsdoc": "39.2.8",
52
52
  "eslint-plugin-jsx-a11y": "6.5.1",
53
53
  "eslint-plugin-node": "11.1.0",
54
54
  "eslint-plugin-promise": "6.0.0",
55
- "eslint-plugin-react": "7.29.3",
56
- "eslint-plugin-react-hooks": "4.3.0",
57
- "eslint-plugin-unicorn": "41.0.0",
55
+ "eslint-plugin-react": "7.29.4",
56
+ "eslint-plugin-react-hooks": "4.4.0",
57
+ "eslint-plugin-unicorn": "42.0.0",
58
58
  "markdownlint-cli": "0.31.1",
59
- "micromatch": "4.0.4",
60
- "postcss-scss": "4.0.3",
61
- "stylelint": "14.5.3",
59
+ "micromatch": "4.0.5",
60
+ "postcss-scss": "4.0.4",
61
+ "stylelint": "14.7.1",
62
62
  "stylelint-declaration-block-no-ignored-properties": "2.5.0",
63
63
  "stylelint-order": "5.0.0",
64
- "stylelint-scss": "4.1.0",
64
+ "stylelint-scss": "4.2.0",
65
65
  "stylelint-selector-no-empty": "1.0.8",
66
66
  "stylelint-use-logical-spec": "3.2.2"
67
67
  },
@@ -72,8 +72,8 @@
72
72
  "devDependencies": {
73
73
  "@types/eslint": "8.4.1",
74
74
  "@types/micromatch": "4.0.2",
75
- "@types/node": "17.0.21",
76
- "stylelint-find-new-rules": "3.0.4",
77
- "typescript": "4.6.2"
75
+ "@types/node": "17.0.27",
76
+ "stylelint-find-new-rules": "4.0.0",
77
+ "typescript": "4.6.3"
78
78
  }
79
79
  }
@@ -157,6 +157,7 @@ module.exports = {
157
157
  ]
158
158
  }
159
159
  ],
160
+ 'declaration-property-max-values': [true, { 'unprefixed-property-name': 4 }],
160
161
  'declaration-no-important': [true, {
161
162
  severity: 'warning'
162
163
  }],
@@ -183,7 +184,7 @@ module.exports = {
183
184
  'function-linear-gradient-no-nonstandard-direction': true,
184
185
  'function-max-empty-lines': 0,
185
186
  'function-name-case': 'lower',
186
- 'function-no-unknown': null, // @todo Create issue for false positives for "color.scale". Need this be covered by the `ignoreFunctions` option?
187
+ 'function-no-unknown': null, // Implemented by scss/function-no-unknown
187
188
  'function-parentheses-newline-inside': 'always-multi-line',
188
189
  'function-parentheses-space-inside': 'never-single-line',
189
190
  'function-url-no-scheme-relative': true,
@@ -289,6 +290,7 @@ module.exports = {
289
290
  'selector-nested-pattern': null,
290
291
  'selector-no-qualifying-type': [true, { ignore: ['attribute', 'class'] }],
291
292
  'selector-no-vendor-prefix': true,
293
+ 'selector-not-notation': 'complex',
292
294
  'selector-pseudo-class-allowed-list': null,
293
295
  'selector-pseudo-class-case': 'lower',
294
296
  'selector-pseudo-class-disallowed-list': null,
@@ -890,6 +892,7 @@ module.exports = {
890
892
  'scss/double-slash-comment-inline': null,
891
893
  'scss/double-slash-comment-whitespace-inside': 'always',
892
894
  'scss/function-color-relative': true,
895
+ 'scss/function-no-unknown': true,
893
896
  'scss/function-quote-no-quoted-strings-inside': true,
894
897
  'scss/function-unquote-no-unquoted-strings-inside': true,
895
898
  'scss/map-keys-quotes': 'always',