linter-bundle 6.2.2 → 6.3.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 +25 -2
- package/README.md +9 -0
- package/eslint/index.cjs +8 -2
- package/eslint/overrides-javascript.cjs +1 -1
- package/helper/linter-bundle-config.d.ts +24 -0
- package/package.json +9 -9
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,30 @@ 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/v6.
|
|
9
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v6.3.0...HEAD)
|
|
10
|
+
|
|
11
|
+
## [6.3.0] - 2024-02-06
|
|
12
|
+
|
|
13
|
+
### Changed
|
|
14
|
+
|
|
15
|
+
- [eslint] Updated `@typescript-eslint/eslint-plugin` from `6.19.1` to `6.21.0`
|
|
16
|
+
- [eslint] Updated `eslint-plugin-unicorn` from `50.0.1` to `51.0.0`
|
|
17
|
+
- [eslint/overrides-jsdoc] Updated `eslint-plugin-jsdoc` from `48.0.3` to `48.0.5`
|
|
18
|
+
- [markdownlint] Updated `markdownlint-cli` from `0.38.0` to `0.39.0`
|
|
19
|
+
- [stylelint] Updated `stylelint` from `16.2.0` to `16.2.1`
|
|
20
|
+
- [eslint] Make use of [`@typescript-eslint/no-array-delete`](https://typescript-eslint.io/rules/no-array-delete/) rule
|
|
21
|
+
- [eslint] Make use of [`@typescript-eslint/no-useless-template-literals`](https://typescript-eslint.io/rules/no-useless-template-literals/) rule
|
|
22
|
+
- [eslint] Make use of [`@typescript-eslint/prefer-find`](https://typescript-eslint.io/rules/prefer-find/) rule
|
|
23
|
+
- [eslint] Make use of [`@typescript-eslint/prefer-promise-reject-errors`](https://typescript-eslint.io/rules/prefer-promise-reject-errors/) rule
|
|
24
|
+
- [markdownlint] Make use of new [`MD054`/link-image-style](https://github.com/DavidAnson/markdownlint/blob/main/doc/md054.md) rule
|
|
25
|
+
- [markdownlint] Make use of new [`MD056`/table-column-count](https://github.com/DavidAnson/markdownlint/blob/main/doc/md056.md) rule
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- [eslint] Added "Params" to the [unicorn/prevent-abbreviations](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v32.0.1/docs/rules/prevent-abbreviations.md) `ignore` list.
|
|
30
|
+
- [eslint] Added the possibility to configure additional options for the [`@typescript-eslint/naming-convention`](https://typescript-eslint.io/rules/naming-convention/) rule in the `overrides.general` linter-bundle configuration
|
|
31
|
+
|
|
32
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v6.2.2...v6.3.0)
|
|
10
33
|
|
|
11
34
|
## [6.2.2] - 2024-01-25
|
|
12
35
|
|
|
@@ -1333,7 +1356,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
1333
1356
|
- [eslint] Make use of new [`jsdoc/no-multi-asterisks`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-no-multi-asterisks) rule
|
|
1334
1357
|
- [eslint] Added but disabled the [`jsdoc/tag-lines`](https://github.com/gajus/eslint-plugin-jsdoc#eslint-plugin-jsdoc-rules-tag-lines) rule
|
|
1335
1358
|
- [eslint] Added but disabled the [`import/no-import-module-exports`](https://github.com/import-js/eslint-plugin-import/blob/master/docs/rules/no-import-module-exports.md) rule
|
|
1336
|
-
- [eslint/overrides-javascript(-lazy)] Added "args"
|
|
1359
|
+
- [eslint/overrides-javascript(-lazy)] Added "args" to the [unicorn/prevent-abbreviations](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/v32.0.1/docs/rules/prevent-abbreviations.md) `ignore` list.
|
|
1337
1360
|
|
|
1338
1361
|
### Changed
|
|
1339
1362
|
|
package/README.md
CHANGED
|
@@ -189,6 +189,15 @@ The file itself, and any of the options is optional.
|
|
|
189
189
|
},
|
|
190
190
|
"import/order": {
|
|
191
191
|
"additionalExternalPatterns": ["@sentry/*"]
|
|
192
|
+
},
|
|
193
|
+
"@typescript-eslint/naming-convention": {
|
|
194
|
+
"additionalOptions": [
|
|
195
|
+
{
|
|
196
|
+
"selector": "variable",
|
|
197
|
+
"modifiers": ["const"],
|
|
198
|
+
"format": ["camelCase"]
|
|
199
|
+
}
|
|
200
|
+
]
|
|
192
201
|
}
|
|
193
202
|
},
|
|
194
203
|
"react": {
|
package/eslint/index.cjs
CHANGED
|
@@ -358,7 +358,7 @@ module.exports = {
|
|
|
358
358
|
'prefer-named-capture-group': 'off', // ES2018+, not supported in most browsers yet
|
|
359
359
|
'prefer-numeric-literals': 'error',
|
|
360
360
|
'prefer-object-spread': 'error',
|
|
361
|
-
'prefer-promise-reject-errors': '
|
|
361
|
+
'prefer-promise-reject-errors': 'off', // Covered by @typescript-eslint/prefer-promise-reject-errors
|
|
362
362
|
'prefer-regex-literals': 'error',
|
|
363
363
|
'prefer-rest-params': 'error',
|
|
364
364
|
'prefer-spread': 'error',
|
|
@@ -551,6 +551,8 @@ module.exports = {
|
|
|
551
551
|
'@typescript-eslint/naming-convention': [
|
|
552
552
|
'error',
|
|
553
553
|
|
|
554
|
+
...ensureType.array(linterBundleConfig.ts?.overrides?.general?.['@typescript-eslint/naming-convention']?.additionalOptions),
|
|
555
|
+
|
|
554
556
|
{ selector: 'default', format: ['camelCase'] },
|
|
555
557
|
|
|
556
558
|
// Variable
|
|
@@ -663,6 +665,7 @@ module.exports = {
|
|
|
663
665
|
{ selector: 'typeParameter', format: ['PascalCase'] }
|
|
664
666
|
],
|
|
665
667
|
'@typescript-eslint/no-array-constructor': 'error',
|
|
668
|
+
'@typescript-eslint/no-array-delete': 'error',
|
|
666
669
|
'@typescript-eslint/no-base-to-string': 'error',
|
|
667
670
|
'@typescript-eslint/no-confusing-non-null-assertion': 'error',
|
|
668
671
|
'@typescript-eslint/no-confusing-void-expression': ['error', { ignoreArrowShorthand: true, ignoreVoidOperator: true }],
|
|
@@ -739,11 +742,13 @@ module.exports = {
|
|
|
739
742
|
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
|
|
740
743
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
741
744
|
'@typescript-eslint/no-useless-empty-export': 'error',
|
|
745
|
+
'@typescript-eslint/no-useless-template-literals': 'error',
|
|
742
746
|
'@typescript-eslint/no-var-requires': 'error',
|
|
743
747
|
'@typescript-eslint/non-nullable-type-assertion-style': 'off', // Conflicts with `no-non-null-assertion`, which we prefer
|
|
744
748
|
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
|
|
745
749
|
'@typescript-eslint/prefer-as-const': 'error',
|
|
746
750
|
'@typescript-eslint/prefer-enum-initializers': 'off',
|
|
751
|
+
'@typescript-eslint/prefer-find': 'error',
|
|
747
752
|
'@typescript-eslint/prefer-for-of': 'error',
|
|
748
753
|
'@typescript-eslint/prefer-function-type': 'error',
|
|
749
754
|
'@typescript-eslint/prefer-includes': 'error',
|
|
@@ -751,6 +756,7 @@ module.exports = {
|
|
|
751
756
|
'@typescript-eslint/prefer-namespace-keyword': 'error',
|
|
752
757
|
'@typescript-eslint/prefer-nullish-coalescing': ['error', { ignoreConditionalTests: true, ignoreMixedLogicalExpressions: true }],
|
|
753
758
|
'@typescript-eslint/prefer-optional-chain': 'error',
|
|
759
|
+
'@typescript-eslint/prefer-promise-reject-errors': 'error',
|
|
754
760
|
'@typescript-eslint/prefer-readonly': 'error',
|
|
755
761
|
'@typescript-eslint/prefer-readonly-parameter-types': ['off', { ignoreInferredTypes: true }], // @todo An interface should ensure that it's properties are readonly, not every usage of it
|
|
756
762
|
'@typescript-eslint/prefer-reduce-type-parameter': 'error',
|
|
@@ -1043,7 +1049,7 @@ module.exports = {
|
|
|
1043
1049
|
'unicorn/prefer-top-level-await': 'off', // @todo Available since 2021. Activate in 2024
|
|
1044
1050
|
'unicorn/prefer-regexp-test': 'error',
|
|
1045
1051
|
'unicorn/prefer-type-error': 'error',
|
|
1046
|
-
'unicorn/prevent-abbreviations': ['error', { ignore: ['args', 'i', 'j', 'i18n',
|
|
1052
|
+
'unicorn/prevent-abbreviations': ['error', { ignore: ['args', 'i', 'j', 'i18n', /[Rr]ef/u, /[Pp]arams/u, /[Pp]rops/u] }],
|
|
1047
1053
|
'unicorn/relative-url-style': 'error',
|
|
1048
1054
|
'unicorn/require-array-join-separator': 'error',
|
|
1049
1055
|
'unicorn/require-number-to-fixed-digits-argument': 'error',
|
|
@@ -101,7 +101,7 @@ module.exports = {
|
|
|
101
101
|
'unicorn/no-process-exit': 'off', // n/no-process-exit
|
|
102
102
|
'unicorn/prefer-module': 'error',
|
|
103
103
|
'unicorn/prefer-node-protocol': 'off', // @todo Requires Node.js v16. Activate in 2025
|
|
104
|
-
'unicorn/prevent-abbreviations': ['error', { ignore: ['args', 'dev', 'env', 'i', 'j', 'i18n', 'pkg',
|
|
104
|
+
'unicorn/prevent-abbreviations': ['error', { ignore: ['args', 'dev', 'env', 'i', 'j', 'i18n', 'pkg', /[Rr]ef/u, 'req', 'res', 'setupDevServerMiddleware'] }],
|
|
105
105
|
'unicorn/text-encoding-identifier-case': 'off'
|
|
106
106
|
}
|
|
107
107
|
},
|
|
@@ -2,6 +2,29 @@
|
|
|
2
2
|
* @file Type definition of `.linter-bundle.js` configuration.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
interface NamingConventionOption {
|
|
6
|
+
// format options
|
|
7
|
+
format: ('camelCase' | 'strictCamelCase' | 'PascalCase' | 'StrictPascalCase' | 'snake_case' | 'UPPER_CASE')[] | null;
|
|
8
|
+
custom?: {
|
|
9
|
+
regex: string;
|
|
10
|
+
match: boolean;
|
|
11
|
+
};
|
|
12
|
+
leadingUnderscore?: 'forbid' | 'require' | 'requireDouble' | 'allow' | 'allowDouble' | 'allowSingleOrDouble';
|
|
13
|
+
trailingUnderscore?: 'forbid' | 'require' | 'requireDouble' | 'allow' | 'allowDouble' | 'allowSingleOrDouble';
|
|
14
|
+
prefix?: string[];
|
|
15
|
+
suffix?: string[];
|
|
16
|
+
|
|
17
|
+
// selector options
|
|
18
|
+
selector: string | string[];
|
|
19
|
+
filter?: string | {
|
|
20
|
+
regex: string;
|
|
21
|
+
match: boolean;
|
|
22
|
+
};
|
|
23
|
+
// the allowed values for these are dependent on the selector - see below
|
|
24
|
+
modifiers?: string[];
|
|
25
|
+
types?: string[];
|
|
26
|
+
}
|
|
27
|
+
|
|
5
28
|
export interface LinterBundleConfig {
|
|
6
29
|
verbose?: boolean;
|
|
7
30
|
timing?: boolean;
|
|
@@ -27,6 +50,7 @@ export interface LinterBundleConfig {
|
|
|
27
50
|
'no-restricted-properties'?: { additionalRestrictions?: { object: string; property: string; message: string; }[]; };
|
|
28
51
|
'no-restricted-syntax'?: { additionalRestrictions?: { selector: string; message: string; }[]; };
|
|
29
52
|
'import/order'?: { additionalExternalPatterns?: string[]; };
|
|
53
|
+
'@typescript-eslint/naming-convention'?: { additionalOptions?: NamingConventionOption[]; };
|
|
30
54
|
};
|
|
31
55
|
react?: {
|
|
32
56
|
'react/forbid-component-props'?: { allowClassNameFor?: string[]; allowStyleFor?: string[]; };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linter-bundle",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.3.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Ready-to use bundle of linting tools, containing configurations for ESLint, stylelint and markdownlint.",
|
|
6
6
|
"keywords": [
|
|
@@ -41,9 +41,9 @@
|
|
|
41
41
|
"_test-stylelint": "node ./test-stylelint.js"
|
|
42
42
|
},
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "6.
|
|
45
|
-
"@typescript-eslint/parser": "6.
|
|
46
|
-
"@typescript-eslint/utils": "6.
|
|
44
|
+
"@typescript-eslint/eslint-plugin": "6.21.0",
|
|
45
|
+
"@typescript-eslint/parser": "6.21.0",
|
|
46
|
+
"@typescript-eslint/utils": "6.21.0",
|
|
47
47
|
"eslint": "8.56.0",
|
|
48
48
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
49
49
|
"eslint-import-resolver-webpack": "0.13.8",
|
|
@@ -51,17 +51,17 @@
|
|
|
51
51
|
"eslint-plugin-functional": "6.0.0",
|
|
52
52
|
"eslint-plugin-import": "2.29.1",
|
|
53
53
|
"eslint-plugin-jest": "27.6.3",
|
|
54
|
-
"eslint-plugin-jsdoc": "48.0.
|
|
54
|
+
"eslint-plugin-jsdoc": "48.0.5",
|
|
55
55
|
"eslint-plugin-jsx-a11y": "6.8.0",
|
|
56
56
|
"eslint-plugin-n": "16.6.2",
|
|
57
57
|
"eslint-plugin-promise": "6.1.1",
|
|
58
58
|
"eslint-plugin-react": "7.33.2",
|
|
59
59
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
60
|
-
"eslint-plugin-unicorn": "
|
|
61
|
-
"markdownlint-cli": "0.
|
|
60
|
+
"eslint-plugin-unicorn": "51.0.0",
|
|
61
|
+
"markdownlint-cli": "0.39.0",
|
|
62
62
|
"micromatch": "4.0.5",
|
|
63
63
|
"postcss-scss": "4.0.9",
|
|
64
|
-
"stylelint": "16.2.
|
|
64
|
+
"stylelint": "16.2.1",
|
|
65
65
|
"stylelint-declaration-block-no-ignored-properties": "2.8.0",
|
|
66
66
|
"stylelint-high-performance-animation": "1.10.0",
|
|
67
67
|
"stylelint-order": "6.0.4",
|
|
@@ -75,7 +75,7 @@
|
|
|
75
75
|
"devDependencies": {
|
|
76
76
|
"@types/eslint": "8.56.2",
|
|
77
77
|
"@types/micromatch": "4.0.6",
|
|
78
|
-
"@types/node": "20.11.
|
|
78
|
+
"@types/node": "20.11.16",
|
|
79
79
|
"stylelint-find-new-rules": "5.0.0",
|
|
80
80
|
"typescript": "5.3.3"
|
|
81
81
|
}
|