linter-bundle 6.3.0 → 7.0.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/.linter-bundle.js +27 -17
- package/.linter-bundle.schema.json +45 -0
- package/CHANGELOG.md +125 -3
- package/README.md +51 -63
- package/eslint/gatsby.mjs +95 -0
- package/eslint/index.mjs +1127 -0
- package/eslint/javascript-lazy.mjs +24 -0
- package/eslint/javascript.mjs +126 -0
- package/eslint/jest.mjs +172 -0
- package/eslint/jsdoc.mjs +103 -0
- package/eslint/react.mjs +232 -0
- package/eslint/rules/no-unnecessary-typeof.md +1 -1
- package/eslint/rules/{no-unnecessary-typeof.js → no-unnecessary-typeof.mjs} +9 -11
- package/eslint/rules/restricted-filenames.md +4 -4
- package/eslint/rules/{restricted-filenames.js → restricted-filenames.mjs} +7 -6
- package/eslint/storybook.mjs +42 -0
- package/eslint/type-declarations.mjs +49 -0
- package/eslint/{overrides-worker.cjs → worker.mjs} +12 -14
- package/eslint.mjs +5 -0
- package/files/index.js +3 -3
- package/helper/{ensure-type.cjs → ensure-type.mjs} +1 -5
- package/helper/get-outdated-dependencies.js +4 -4
- package/helper/get-outdated-overrides.js +2 -2
- package/helper/get-stylelint-path.js +4 -3
- package/helper/is-npm-or-yarn.js +2 -2
- package/helper/linter-bundle-config.js +9 -14
- package/helper/run-process.js +1 -1
- package/lint.js +21 -16
- package/package.json +31 -29
- package/stylelint/index.mjs +1111 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/{selectors.cjs → selectors.mjs} +15 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/{index.cjs → index.mjs} +6 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/{index.cjs → index.mjs} +11 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/{index.cjs → index.mjs} +18 -22
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{atRuleNameSpaceChecker.cjs → atRuleNameSpaceChecker.mjs} +4 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/{index.cjs → index.mjs} +16 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/{index.cjs → index.mjs} +13 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/{index.cjs → index.mjs} +11 -40
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/{index.cjs → index.mjs} +10 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/{index.cjs → index.mjs} +14 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/{index.cjs → index.mjs} +13 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/{index.cjs → index.mjs} +14 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.mjs +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/{index.cjs → index.mjs} +11 -29
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/{index.cjs → index.mjs} +9 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/{index.cjs → index.mjs} +10 -23
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/{index.cjs → index.mjs} +11 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/{index.cjs → index.mjs} +9 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/{index.cjs → index.mjs} +9 -25
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationBangSpaceChecker.cjs → declarationBangSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationColonSpaceChecker.cjs → declarationColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{findMediaOperator.cjs → findMediaOperator.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/{index.cjs → index.mjs} +19 -39
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/{index.cjs → index.mjs} +19 -54
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/{index.cjs → index.mjs} +21 -68
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/{index.cjs → index.mjs} +16 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceChecker.cjs → functionCommaSpaceChecker.mjs} +8 -7
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceFix.cjs → functionCommaSpaceFix.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/{index.cjs → index.mjs} +39 -64
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/{index.cjs → index.mjs} +15 -44
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/{index.cjs → index.mjs} +10 -49
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/{index.cjs → index.mjs} +9 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/{index.cjs → index.mjs} +8 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaFeatureColonSpaceChecker.cjs → mediaFeatureColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaQueryListCommaWhitespaceChecker.cjs → mediaQueryListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/{index.cjs → index.mjs} +6 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/{index.cjs → index.mjs} +13 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/{index.cjs → index.mjs} +10 -33
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/{index.cjs → index.mjs} +7 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/{index.cjs → index.mjs} +13 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/{index.cjs → index.mjs} +9 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/{index.cjs → index.mjs} +9 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/{index.cjs → index.mjs} +9 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/{index.cjs → index.mjs} +9 -14
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/{index.cjs → index.mjs} +10 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/{index.cjs → index.mjs} +10 -24
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/{index.cjs → index.mjs} +12 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/{index.cjs → index.mjs} +10 -15
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorAttributeOperatorSpaceChecker.cjs → selectorAttributeOperatorSpaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorCombinatorSpaceChecker.cjs → selectorCombinatorSpaceChecker.mjs} +12 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorListCommaWhitespaceChecker.cjs → selectorListCommaWhitespaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/{index.cjs → index.mjs} +43 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/{index.cjs → index.mjs} +5 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/{index.cjs → index.mjs} +17 -34
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/{index.cjs → index.mjs} +12 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{valueListCommaWhitespaceChecker.cjs → valueListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{addEmptyLineAfter.cjs → addEmptyLineAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{hasEmptyBlock.cjs → hasEmptyBlock.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{nextNonCommentNode.cjs → nextNonCommentNode.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{removeEmptyLinesAfter.cjs → removeEmptyLinesAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/transformSelector.mjs +19 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{whitespaceChecker.cjs → whitespaceChecker.mjs} +5 -5
- package/stylelint/plugins/stylelint-selector-no-empty.js +2 -0
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +2 -2
- package/stylelint.mjs +6 -0
- package/TODO.md +0 -58
- package/eslint/index.cjs +0 -1071
- package/eslint/overrides-gatsby.cjs +0 -108
- package/eslint/overrides-javascript-lazy.cjs +0 -27
- package/eslint/overrides-javascript.cjs +0 -121
- package/eslint/overrides-jest.cjs +0 -144
- package/eslint/overrides-jsdoc.cjs +0 -94
- package/eslint/overrides-react.cjs +0 -220
- package/eslint/overrides-storybook.cjs +0 -44
- package/eslint/overrides-type-declarations.cjs +0 -51
- package/eslint/rules/no-global-undefined-check.js +0 -85
- package/eslint/rules/no-global-undefined-check.md +0 -34
- package/eslint.cjs +0 -5
- package/stylelint/index.cjs +0 -1104
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.cjs +0 -95
- package/stylelint.cjs +0 -5
package/.linter-bundle.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Configuration used for linting the linter-bundle.
|
|
3
|
+
*/
|
|
4
|
+
|
|
1
5
|
const snippets = {
|
|
2
|
-
lowerCase: '[a-z]*([a-z0-9])',
|
|
3
|
-
upperCase: '[A-Z]*([A-Z0-9])',
|
|
4
|
-
snakeCase: '[a-z]*(*([a-z0-9]_)+([a-z0-9]))',
|
|
5
|
-
screamingSnakeCase: '[A-Z]*(*([A-Z0-9]_)+([A-Z0-9]))',
|
|
6
6
|
kebabCase: '[a-z]*(*([a-z0-9]-)+([a-z0-9]))',
|
|
7
|
-
camelCase: '[a-z]*([a-zA-Z0-9])'
|
|
8
|
-
pascalCase: '[A-Z]*([a-zA-Z0-9])'
|
|
7
|
+
camelCase: '[a-z]*([a-zA-Z0-9])'
|
|
9
8
|
};
|
|
10
9
|
|
|
11
10
|
export default {
|
|
@@ -19,18 +18,18 @@ export default {
|
|
|
19
18
|
'.git/**',
|
|
20
19
|
'.github/FUNDING.yml',
|
|
21
20
|
'.vscode/settings.json',
|
|
22
|
-
|
|
23
|
-
`eslint/rules/${snippets.kebabCase}.{js,md}`,
|
|
24
|
-
`eslint
|
|
21
|
+
'eslint/rules/package.json',
|
|
22
|
+
`eslint/rules/${snippets.kebabCase}.{js,mjs,md}`,
|
|
23
|
+
`eslint/${snippets.kebabCase}.mjs`,
|
|
25
24
|
'files/index.js',
|
|
26
|
-
`helper/${snippets.kebabCase}.{js,cjs,d.ts}`,
|
|
25
|
+
`helper/${snippets.kebabCase}.{js,cjs,mjs,d.ts}`,
|
|
27
26
|
'markdownlint/base.json',
|
|
28
27
|
'node_modules/**',
|
|
29
|
-
'stylelint/index.
|
|
28
|
+
'stylelint/index.mjs',
|
|
30
29
|
`stylelint/plugins/stylelint-${snippets.kebabCase}.js`,
|
|
31
|
-
`stylelint/plugins/stylelint-15.11.0-stylistic/**/{${snippets.camelCase}.
|
|
30
|
+
`stylelint/plugins/stylelint-15.11.0-stylistic/**/{${snippets.camelCase}.mjs,README.md,LICENSE}`,
|
|
32
31
|
'.editorconfig',
|
|
33
|
-
'.
|
|
32
|
+
'eslint.config.mjs',
|
|
34
33
|
'.gitattributes',
|
|
35
34
|
'.gitignore',
|
|
36
35
|
'.linter-bundle.js',
|
|
@@ -38,13 +37,13 @@ export default {
|
|
|
38
37
|
'.markdownlint.json',
|
|
39
38
|
'.npmignore',
|
|
40
39
|
'*.md',
|
|
41
|
-
'eslint.
|
|
40
|
+
'eslint.mjs',
|
|
42
41
|
'LICENSE',
|
|
43
42
|
'lint.js',
|
|
44
43
|
'package-lock.json',
|
|
45
44
|
'package.json',
|
|
46
|
-
'stylelint.
|
|
47
|
-
'stylelint.config.
|
|
45
|
+
'stylelint.mjs',
|
|
46
|
+
'stylelint.config.js',
|
|
48
47
|
'test-stylelint.js',
|
|
49
48
|
'tsconfig.json',
|
|
50
49
|
'vscode-eslint-1.png',
|
|
@@ -52,5 +51,16 @@ export default {
|
|
|
52
51
|
]
|
|
53
52
|
}
|
|
54
53
|
]
|
|
54
|
+
},
|
|
55
|
+
ts: {
|
|
56
|
+
overrides: {
|
|
57
|
+
general: {
|
|
58
|
+
'import/order': {
|
|
59
|
+
additionalExternalPatterns: [
|
|
60
|
+
'@stylistic/**'
|
|
61
|
+
]
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
55
65
|
}
|
|
56
|
-
}
|
|
66
|
+
};
|
|
@@ -14,6 +14,15 @@
|
|
|
14
14
|
"files": {
|
|
15
15
|
"type": "object",
|
|
16
16
|
"properties": {
|
|
17
|
+
"git": {
|
|
18
|
+
"type": "boolean"
|
|
19
|
+
},
|
|
20
|
+
"include": {
|
|
21
|
+
"type": "array",
|
|
22
|
+
"items": {
|
|
23
|
+
"type": "string"
|
|
24
|
+
}
|
|
25
|
+
},
|
|
17
26
|
"restrictions": {
|
|
18
27
|
"type": "array",
|
|
19
28
|
"items": {
|
|
@@ -59,6 +68,12 @@
|
|
|
59
68
|
"ts": {
|
|
60
69
|
"type": "object",
|
|
61
70
|
"properties": {
|
|
71
|
+
"timing": {
|
|
72
|
+
"type": "boolean"
|
|
73
|
+
},
|
|
74
|
+
"git": {
|
|
75
|
+
"type": "boolean"
|
|
76
|
+
},
|
|
62
77
|
"tsconfig": {
|
|
63
78
|
"type": "string"
|
|
64
79
|
},
|
|
@@ -92,12 +107,42 @@
|
|
|
92
107
|
"sass": {
|
|
93
108
|
"type": "object",
|
|
94
109
|
"properties": {
|
|
110
|
+
"verbose": {
|
|
111
|
+
"type": "boolean"
|
|
112
|
+
},
|
|
113
|
+
"timing": {
|
|
114
|
+
"type": "boolean"
|
|
115
|
+
},
|
|
116
|
+
"git": {
|
|
117
|
+
"type": "boolean"
|
|
118
|
+
},
|
|
119
|
+
"include": {
|
|
120
|
+
"type": "array",
|
|
121
|
+
"items": {
|
|
122
|
+
"type": "string"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
95
125
|
"patternPrefix": {
|
|
96
126
|
"type": "string"
|
|
97
127
|
}
|
|
98
128
|
},
|
|
99
129
|
"additionalProperties": false
|
|
100
130
|
},
|
|
131
|
+
"md": {
|
|
132
|
+
"type": "object",
|
|
133
|
+
"properties": {
|
|
134
|
+
"git": {
|
|
135
|
+
"type": "boolean"
|
|
136
|
+
},
|
|
137
|
+
"include": {
|
|
138
|
+
"type": "array",
|
|
139
|
+
"items": {
|
|
140
|
+
"type": "string"
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"additionalProperties": false
|
|
145
|
+
},
|
|
101
146
|
"audit": {
|
|
102
147
|
"type": "object",
|
|
103
148
|
"properties": {
|
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,129 @@ 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/
|
|
9
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v7.0.0...HEAD)
|
|
10
|
+
|
|
11
|
+
## [7.0.0] - 2025-03-11
|
|
12
|
+
|
|
13
|
+
### Breaking Changes
|
|
14
|
+
|
|
15
|
+
- [general] All configuration files have been migrated from CommonJS to ESModules
|
|
16
|
+
- [general] The global configuration variable `global.linterBundleSettings` has been replaced by a `.linter-bundle.json` / `.linter-bundle.mjs` / `.linter-bundle.cjs` / `.linter-bundle.js` configuration file in the projects root directory
|
|
17
|
+
- [eslint] It's now using the ESLint Flat Config format
|
|
18
|
+
- [eslint] `.eslintrc.js` needs to be renamed to `eslint.config.mjs`, `module.exports =` needs to be replaced by `export default [`. See [eslint.org](https://eslint.org/docs/latest/use/configure/migration-guide#key-differences-between-configuration-formats) website additional required changes
|
|
19
|
+
- [eslint] The VSCode configuration needs to be adapted. See [README.md](./README.md)
|
|
20
|
+
- [eslint] The prefixes "override-" has been removed from the specialized rule files and the suffix `.cjs` has been replaced by `.mjs`
|
|
21
|
+
- [stylelint] The stylelint configuration has been renamed from `linter-bundle/stylelint.cjs` to `linter-bundle/stylelint.mjs`
|
|
22
|
+
- [stylelint] As the interface for rules changed slightly, I had to remove some auto-fixes for the previously forked stylistic rules.
|
|
23
|
+
- [general] Drop support for Node.js version less than v20.9.0 and v21.1.0 as a lot of ESLint plugins are not supporting them
|
|
24
|
+
|
|
25
|
+
### Fixed
|
|
26
|
+
|
|
27
|
+
- [eslint] Fixed "Error reading .linter-bundle.js" in VSCode in some conditions
|
|
28
|
+
|
|
29
|
+
Beside these changes:
|
|
30
|
+
|
|
31
|
+
### Changed
|
|
32
|
+
|
|
33
|
+
- [general] `"extends"` in the .eslintrc.js needs to be suffixed with the ".mjs" file extension (e.g. `require.resolve('linter-bundle/eslint.mjs')`)
|
|
34
|
+
- [general] `"extends"` in the stylelint.config.js needs to be suffixed with the ".mjs" file extension (e.g. `require.resolve('linter-bundle/stylelint.mjs')`)
|
|
35
|
+
- [eslint] Updated `@typescript-eslint` from `6.21.0` to `8.26.1`
|
|
36
|
+
- [eslint] Updated `eslint` from `8.56.0` to `9.22.0`
|
|
37
|
+
- [eslint] Updated `eslint-import-resolver-typescript` from `3.6.1` to `3.8.4`
|
|
38
|
+
- [eslint] Updated `eslint-import-resolver-webpack` from `0.13.8` to `0.13.10`
|
|
39
|
+
- [eslint] Updated `eslint-plugin-functional` from `6.0.0` to `9.0.1`
|
|
40
|
+
- [eslint] Updated `eslint-plugin-jest` from `27.6.3` to `28.11.0`
|
|
41
|
+
- [eslint] Updated `eslint-plugin-jsdoc` from `48.0.5` to `50.6.6`
|
|
42
|
+
- [eslint] Updated `eslint-plugin-jsx-a11y` from `6.8.0` to `6.10.2`
|
|
43
|
+
- [eslint] Updated `eslint-plugin-n` from `16.6.2` to `17.16.2`
|
|
44
|
+
- [eslint] Updated `eslint-plugin-promise` from `6.1.1` to `7.2.1`
|
|
45
|
+
- [eslint] Updated `eslint-plugin-react` from `7.33.2` to `7.37.4`
|
|
46
|
+
- [eslint] Updated `eslint-plugin-react-hooks` from `4.6.0` to `5.2.0`
|
|
47
|
+
- [eslint] Updated `eslint-plugin-unicorn` from `51.0.0` to `57.0.0`
|
|
48
|
+
- [eslint] Updated `@stylistic/eslint-plugin` from `2.11.0` to `4.2.0`
|
|
49
|
+
- [markdownlint] Updated `markdownlint-cli` from `0.39.0` to `0.44.0`
|
|
50
|
+
- [stylelint] Updated `stylelint` from `16.2.1` to `16.15.0`
|
|
51
|
+
- [stylelint] Updated `stylelint-scss` from `6.1.0` to `6.11.1`
|
|
52
|
+
- [stylelint] Updated `stylelint-high-performance-animation` from `1.10.0` to `1.11.0`
|
|
53
|
+
- [audit] Updated `better-npm-audit` from `3.7.3` to `3.11.0`
|
|
54
|
+
- [eslint] Activate `checkTypePredicates` of [`@typescript-eslint/no-unnecessary-condition`](https://typescript-eslint.io/rules/no-unnecessary-condition/) rule
|
|
55
|
+
- [eslint] Adjusted `@typescript-eslint/naming-convention` rule configuration to allow constant names starting with "_" if they are unused
|
|
56
|
+
- [eslint] Renamed the rule `no-unnecessary-typeof` to `linter-bundle/no-unnecessary-typeof`
|
|
57
|
+
- [eslint] Renamed the rule `restricted-filenames` to `linter-bundle/restricted-filenames`
|
|
58
|
+
- [eslint] Increase `max` of `import/max-dependencies` rule from 20 to 25
|
|
59
|
+
- [eslint] Disabled `unicorn/string-content` as it sometimes breaks code (e.g. imports with `...` in Next.js or GraphQL template strings)
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- [eslint] Added "_" and "c" to allowed id names in [`id-length`] rule
|
|
64
|
+
- [eslint] Added [`@typescript-eslint/no-unnecessary-template-expression`](https://typescript-eslint.io/rules/no-unnecessary-template-expression/) rule (replaces `@typescript-eslint/no-useless-template-literals`)
|
|
65
|
+
- [eslint] Added but disabled new [`functional/no-class-inheritance`](https://github.com/eslint-functional/eslint-plugin-functional/blob/main/docs/rules/no-class-inheritance.md) rule
|
|
66
|
+
- [eslint] Added new [`@typescript-eslint/consistent-return`](https://typescript-eslint.io/rules/consistent-return/) rule
|
|
67
|
+
- [eslint] Added new [`@typescript-eslint/no-unnecessary-parameter-property-assignment`](https://typescript-eslint.io/rules/no-unnecessary-parameter-property-assignment/) rule
|
|
68
|
+
- [eslint] Added new [`@typescript-eslint/no-unnecessary-type-parameters`](https://typescript-eslint.io/rules/no-unnecessary-type-parameters/) rule
|
|
69
|
+
- [eslint] Added new [`@typescript-eslint/no-unsafe-type-assertion`](https://typescript-eslint.io/rules/no-unsafe-type-assertion/) rule
|
|
70
|
+
- [eslint] Added new [`@typescript-eslint/no-useless-assignment`](https://eslint.org/docs/latest/rules/no-useless-assignment) rule
|
|
71
|
+
- [eslint] Added new [`@typescript-eslint/only-throw-error`](https://typescript-eslint.io/rules/only-throw-error/) rule
|
|
72
|
+
- [eslint] Added new [`@typescript-eslint/use-unknown-in-catch-callback-variable`](https://typescript-eslint.io/rules/use-unknown-in-catch-callback-variable/) rule
|
|
73
|
+
- [eslint] Added new [`no-empty-object-type`](https://typescript-eslint.io/rules/no-empty-object-type/) rule
|
|
74
|
+
- [eslint] Added new [`promise/spec-only`](https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/spec-only.md) rule
|
|
75
|
+
- [eslint] Added new [`unicorn/consistent-empty-array-spread`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-empty-array-spread.md) rule
|
|
76
|
+
- [eslint] Added new [`unicorn/consistent-existence-index-check`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-existence-index-check.md) rule
|
|
77
|
+
- [eslint] Added new [`unicorn/no-invalid-fetch-options`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-invalid-fetch-options.md) rule
|
|
78
|
+
- [eslint] Added new [`unicorn/no-length-as-slice-end`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-length-as-slice-end.md) rule
|
|
79
|
+
- [eslint] Added new [`unicorn/no-magic-array-flat-depth`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-magic-array-flat-depth.md) rule
|
|
80
|
+
- [eslint] Added new [`unicorn/no-negation-in-equality-check`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-negation-in-equality-check.md) rule
|
|
81
|
+
- [eslint] Added new [`unicorn/prefer-global-this`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-global-this.md) rule
|
|
82
|
+
- [eslint] Added new [`unicorn/prefer-math-min-max`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-math-min-max.md) rule
|
|
83
|
+
- [eslint] Added new [`unicorn/prefer-string-raw`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-string-raw.md) rule
|
|
84
|
+
- [eslint] Added new [`unicorn/prefer-structured-clone`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-structured-clone.md) rule
|
|
85
|
+
- [eslint] Added new [`unicorn/consistent-date-clone`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-date-clone.md) rule
|
|
86
|
+
- [eslint] Added new [`unicorn/consistent-assert`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/consistent-assert.md) rule
|
|
87
|
+
- [eslint] Added new [`unicorn/no-accessor-recursion`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-accessor-recursion.md) rule
|
|
88
|
+
- [eslint] Added new [`unicorn/no-instanceof-builtins`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-builtins.md) rule
|
|
89
|
+
- [eslint] Added new [`unicorn/no-named-default`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-named-default.md) rule
|
|
90
|
+
- [eslint] Replaced deprecated `unicorn/no-instanceof-array` by new [`unicorn/no-instanceof-builtins`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-instanceof-builtins.md) rule
|
|
91
|
+
- [eslint] Activate `linterOptions.reportUnusedInlineConfigs` setting
|
|
92
|
+
- [eslint/jsdoc] Added [`jsdoc/require-template`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/require-template.md) rule
|
|
93
|
+
- [eslint/jsdoc] Added but disabled new [jsdoc/convert-to-jsdoc-comments`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/convert-to-jsdoc-comments.md) rule
|
|
94
|
+
- [eslint/jsdoc] Added new [`jsdoc/check-template-names`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/check-template-names.md) rule
|
|
95
|
+
- [eslint/jsdoc] Added new [`jsdoc/lines-before-block`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/lines-before-block.md) rule with disabled `ignoreSameLine`
|
|
96
|
+
- [eslint/react] Added new [`react/forward-ref-uses-ref`](https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.36.0/docs/rules/forward-ref-uses-ref.md) rule
|
|
97
|
+
- [eslint/react] Activate `ignoreTranspilerName` for [`react/display-name`](https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/display-name.md)
|
|
98
|
+
- [eslint/react] Activate `unicorn/prefer-node-protocol` rule
|
|
99
|
+
- [eslint/react] Added new [`react/checked-requires-onchange-or-readonly`](https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.34.0/docs/rules/checked-requires-onchange-or-readonly.md) rule
|
|
100
|
+
- [eslint/react] Added new [`react/jsx-props-no-spread-multi`](https://github.com/jsx-eslint/eslint-plugin-react/blob/v7.35.0/docs/rules/jsx-props-no-spread-multi.md) rule
|
|
101
|
+
- [eslint/jest] Added but disabled new[`jest/prefer-importing-jest-globals`](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-importing-jest-globals.md) rule
|
|
102
|
+
- [eslint/jest] Added new [`jest/prefer-jest-mocked`](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-jest-mocked.md) rule
|
|
103
|
+
- [eslint/promise] Added new [`promise/prefer-catch`](https://github.com/eslint-community/eslint-plugin-promise/blob/main/docs/rules/prefer-catch.md) rule
|
|
104
|
+
- [markdownlint] Added new [`MD058/blanks-around-tables`](https://github.com/DavidAnson/markdownlint/blob/main/doc/md058.md) rule
|
|
105
|
+
- [stylelint] Added and disabled new [`scss/at-import-partial-extension-allowed-list`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-import-partial-extension-allowed-list/README.md) rule, and removed deprecated `at-import-partial-extension-whitelist` rule
|
|
106
|
+
- [stylelint] Added and disabled new [`scss/at-import-partial-extension-disallowed-list`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-import-partial-extension-disallowed-list/README.md) rule, and removed deprecated `at-import-partial-extension-blacklist rule` rule
|
|
107
|
+
- [stylelint] Added new [`no-unknown-custom-media`](https://stylelint.io/user-guide/rules/no-unknown-custom-media/) rule
|
|
108
|
+
- [stylelint] Added new [`scss/at-mixin-no-risky-nesting-selector`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-mixin-no-risky-nesting-selector/README.md) rule
|
|
109
|
+
- [stylelint] Added new [`scss/declaration-property-value-no-unknown`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/declaration-property-value-no-unknown/README.md) rule, which disabled `declaration-property-value-no-unknown`
|
|
110
|
+
- [stylelint] Added new [`scss/function-color-channel`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/function-color-channel/README.md) rule
|
|
111
|
+
- [stylelint] Added new [`scss/load-partial-extension`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/load-partial-extension/README.md) rule, and removed deprecated `at-import-partial-extension` rule
|
|
112
|
+
- [stylelint] Added new [`scss/no-duplicate-load-rules`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/no-duplicate-load-rules) rule
|
|
113
|
+
- [stylelint] Added new [`at-rule-descriptor-no-unknown`](https://stylelint.io/user-guide/rules/at-rule-descriptor-no-unknown/) rule
|
|
114
|
+
- [stylelint] Added new [`at-rule-descriptor-value-no-unknown`](https://stylelint.io/user-guide/rules/at-rule-descriptor-value-no-unknown/) rule
|
|
115
|
+
- [stylelint] Added new [`at-rule-no-deprecated`](https://stylelint.io/user-guide/rules/at-rule-no-deprecated/) rule
|
|
116
|
+
- [stylelint] Added new [`at-rule-prelude-no-invalid`](https://stylelint.io/user-guide/rules/at-rule-prelude-no-invalid/) rule
|
|
117
|
+
- [stylelint] Added new [`declaration-property-value-keyword-no-deprecated`](https://stylelint.io/user-guide/rules/declaration-property-value-keyword-no-deprecated/) rule
|
|
118
|
+
- [stylelint] Added new [`syntax-string-no-invalid`](https://stylelint.io/user-guide/rules/syntax-string-no-invalid/) rule
|
|
119
|
+
- [stylelint] Show rule performance information
|
|
120
|
+
- [stylelint] Activated [`reportUnscopedDisables`] setting
|
|
121
|
+
|
|
122
|
+
### Removed
|
|
123
|
+
|
|
124
|
+
- [eslint] Removed deprecated `@typescript-eslint/ban-types` rule
|
|
125
|
+
- [eslint] Removed deprecated `@typescript-eslint/no-throw-literal` rule
|
|
126
|
+
- [eslint] Removed deprecated `no-new-symbol` rule
|
|
127
|
+
- [eslint] Removed deprecated `prefer-ts-expect-error` rule
|
|
128
|
+
- [eslint] Replaced deprecated `@typescript-eslint/no-loss-of-precision` rule by ESLint `no-loss-of-precision`
|
|
129
|
+
- [eslint/gatsby] Removed `no-global-undefined-check` rule
|
|
130
|
+
|
|
131
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v6.3.0...v7.0.0)
|
|
10
132
|
|
|
11
133
|
## [6.3.0] - 2024-02-06
|
|
12
134
|
|
|
@@ -716,7 +838,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
716
838
|
### Added
|
|
717
839
|
|
|
718
840
|
- [eslint] Make use of [`@typescript-eslint/no-restricted-imports`](https://typescript-eslint.io/rules/no-restricted-imports/) rule
|
|
719
|
-
- [eslint] Make use of [`@
|
|
841
|
+
- [eslint] Make use of [`@stylistic/space-infix-ops`](https://typescript-eslint.io/rules/space-infix-ops/) rule
|
|
720
842
|
- [eslint] Make use of [`@typescript-eslint/consistent-generic-constructors`](https://typescript-eslint.io/rules/consistent-generic-constructors/) rule
|
|
721
843
|
- [eslint/overrides-jest] Make use of [`jest/prefer-hooks-in-order`](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/prefer-hooks-in-order.md) rule
|
|
722
844
|
- [eslint/overrides-jest] Make use of [`jest/max-expects`](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/max-expects.md) rule
|
|
@@ -1497,7 +1619,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
|
1497
1619
|
- [eslint] Updated `eslint-plugin-jest` from v24.3.2 to v24.3.5
|
|
1498
1620
|
- [eslint] Updated `eslint-plugin-react` from v7.22.0 to v7.23.2
|
|
1499
1621
|
- [eslint] Make use of new [`react/no-unstable-nested-components`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-unstable-nested-components.md) rule
|
|
1500
|
-
- [
|
|
1622
|
+
- [stylelint] Updated `stylelint-selector-no-empty` from v1.0.7 to v1.0.8
|
|
1501
1623
|
- [audit] Updated `better-npm-audit` from v1.0.7 to v1.0.8
|
|
1502
1624
|
|
|
1503
1625
|
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v1.9.0...v1.10.0)
|
package/README.md
CHANGED
|
@@ -22,6 +22,9 @@ This setup is using the following additional plugins:
|
|
|
22
22
|
|
|
23
23
|
### ESLint
|
|
24
24
|
|
|
25
|
+
The `linter-bundle` is using the Flat Configuration Format which was introduced in ESLint v8.
|
|
26
|
+
|
|
27
|
+
- [@stylistic/eslint-plugin](https://eslint.style/)
|
|
25
28
|
- [@typescript-eslint/eslint-plugin](https://www.npmjs.com/package/@typescript-eslint/eslint-plugin)
|
|
26
29
|
- [eslint-plugin-eslint-comments](https://www.npmjs.com/package/eslint-plugin-eslint-comments)
|
|
27
30
|
- [eslint-plugin-functional](https://www.npmjs.com/package/eslint-plugin-functional)
|
|
@@ -37,9 +40,8 @@ This setup is using the following additional plugins:
|
|
|
37
40
|
|
|
38
41
|
Beside that, the following additional rules are part of this bundle:
|
|
39
42
|
|
|
40
|
-
- [no-
|
|
41
|
-
- [
|
|
42
|
-
- [restricted-filenames](./eslint/rules/restricted-filenames.md)
|
|
43
|
+
- [linter-bundle/no-unnecessary-typeof](./eslint/rules/no-unnecessary-typeof.md)
|
|
44
|
+
- [linter-bundle/restricted-filenames](./eslint/rules/restricted-filenames.md)
|
|
43
45
|
|
|
44
46
|
### stylelint
|
|
45
47
|
|
|
@@ -64,7 +66,7 @@ If these plugins are maintained again, the plugins will also be used again.
|
|
|
64
66
|
|
|
65
67
|
## Install
|
|
66
68
|
|
|
67
|
-
Ensure you are using atleast Node.js version
|
|
69
|
+
Ensure you are using atleast Node.js version 20.9.0/21.1.0.
|
|
68
70
|
|
|
69
71
|
```sh
|
|
70
72
|
npm install linter-bundle --save-dev
|
|
@@ -83,45 +85,43 @@ npm install linter-bundle --save-dev
|
|
|
83
85
|
}
|
|
84
86
|
```
|
|
85
87
|
|
|
86
|
-
#### .
|
|
88
|
+
#### eslint.config.mjs
|
|
87
89
|
|
|
88
90
|
```js
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
]
|
|
102
|
-
};
|
|
91
|
+
export default [
|
|
92
|
+
...(await import('linter-bundle/eslint.mjs')).default,
|
|
93
|
+
// ...(await import('linter-bundle/eslint/gatsby.mjs')).default,
|
|
94
|
+
// ...(await import('linter-bundle/eslint/javascript.mjs')).default,
|
|
95
|
+
...(await import('linter-bundle/eslint/javascript-lazy.mjs')).default,
|
|
96
|
+
// ...(await import('linter-bundle/eslint/jest.mjs')).default,
|
|
97
|
+
...(await import('linter-bundle/eslint/jsdoc.mjs')).default,
|
|
98
|
+
// ...(await import('linter-bundle/eslint/react.mjs')).default,
|
|
99
|
+
// ...(await import('linter-bundle/eslint/storybook.mjs')).default,
|
|
100
|
+
// ...(await import('linter-bundle/eslint/type-declarations.mjs')).default,
|
|
101
|
+
// ...(await import('linter-bundle/eslint/worker.mjs')).default
|
|
102
|
+
]
|
|
103
103
|
```
|
|
104
104
|
|
|
105
105
|
##### Available `extends`
|
|
106
106
|
|
|
107
107
|
Source | Description | Rules setup
|
|
108
108
|
-|-|-
|
|
109
|
-
`linter-bundle/eslint.
|
|
110
|
-
`linter-bundle/eslint/
|
|
111
|
-
`linter-bundle/eslint/
|
|
112
|
-
`linter-bundle/eslint/
|
|
113
|
-
`linter-bundle/eslint/
|
|
114
|
-
`linter-bundle/eslint/
|
|
115
|
-
`linter-bundle/eslint/
|
|
116
|
-
`linter-bundle/eslint/
|
|
117
|
-
`linter-bundle/eslint/
|
|
118
|
-
`linter-bundle/eslint/
|
|
109
|
+
`linter-bundle/eslint.mjs` | General rule setup. This is also the base for the following specialized rule sets. | [View](./eslint/index.mjs)
|
|
110
|
+
`linter-bundle/eslint/gatsby.mjs` | Settings for Gatsby-based projects. | [View](./eslint/gatsby.mjs)
|
|
111
|
+
`linter-bundle/eslint/javascript.mjs` | Strict settings for JavaScript files, which enforces correct types everywhere. | [View](./eslint/javascript.mjs)
|
|
112
|
+
`linter-bundle/eslint/javascript-lazy.mjs` | Can be used instead of `javascript`. It's less strict and allows the `any` type. | [View](./eslint/javascript-lazy.mjs)
|
|
113
|
+
`linter-bundle/eslint/jest.mjs` | Settings for projects using Jest. | [View](./eslint/jest.mjs)
|
|
114
|
+
`linter-bundle/eslint/jsdoc.mjs` | Settings for projects using JSDoc comments. | [View](./eslint/jsdoc.mjs)
|
|
115
|
+
`linter-bundle/eslint/react.mjs` | Settings for projects using React comments. | [View](./eslint/react.mjs)
|
|
116
|
+
`linter-bundle/eslint/storybook.mjs` | Settings for projects using Storybook comments. | [View](./eslint/storybook.mjs)
|
|
117
|
+
`linter-bundle/eslint/type-declarations.mjs` | Settings for type declaration files (.d.ts). | [View](./eslint/type-declarations.mjs)
|
|
118
|
+
`linter-bundle/eslint/worker.mjs` | Settings for projects using Web Workers. | [View](./eslint/worker.mjs)
|
|
119
119
|
|
|
120
120
|
#### stylelint.config.js
|
|
121
121
|
|
|
122
122
|
```js
|
|
123
|
-
|
|
124
|
-
extends: 'linter-bundle/stylelint.
|
|
123
|
+
export default {
|
|
124
|
+
extends: 'linter-bundle/stylelint.mjs'
|
|
125
125
|
};
|
|
126
126
|
|
|
127
127
|
```
|
|
@@ -140,7 +140,7 @@ module.exports = {
|
|
|
140
140
|
.eslintcache
|
|
141
141
|
```
|
|
142
142
|
|
|
143
|
-
### .linter-bundle.json / .linter-bundle.
|
|
143
|
+
### .linter-bundle.json / .linter-bundle.mjs / .linter-bundle.js
|
|
144
144
|
|
|
145
145
|
`linter-bundle` supports a couple of additional options, which can be configured in the configuration file, in the root of your project.
|
|
146
146
|
Some of the options are also available as command line arguments (see below).
|
|
@@ -210,7 +210,7 @@ The file itself, and any of the options is optional.
|
|
|
210
210
|
},
|
|
211
211
|
"sass": {
|
|
212
212
|
"include": ["./included/*.ts"],
|
|
213
|
-
"patternPrefix": "
|
|
213
|
+
"patternPrefix": "(my-prefix|another-prefix)"
|
|
214
214
|
},
|
|
215
215
|
"md": {
|
|
216
216
|
"include": ["./included/*.md"],
|
|
@@ -242,7 +242,7 @@ The file itself, and any of the options is optional.
|
|
|
242
242
|
<details><summary>Click here to see the example configuration with descriptions</summary>
|
|
243
243
|
|
|
244
244
|
```js
|
|
245
|
-
|
|
245
|
+
export default {
|
|
246
246
|
/**
|
|
247
247
|
* Same as `--verbose` command line argument.
|
|
248
248
|
*
|
|
@@ -268,13 +268,6 @@ module.exports = {
|
|
|
268
268
|
* Configuration, specific to the `tsc` command.
|
|
269
269
|
*/
|
|
270
270
|
tsc: {
|
|
271
|
-
/**
|
|
272
|
-
* `verbose`, `timing` and `git` are the same as in the root node.
|
|
273
|
-
*/
|
|
274
|
-
verbose: true,
|
|
275
|
-
timing: true,
|
|
276
|
-
git: true,
|
|
277
|
-
|
|
278
271
|
/**
|
|
279
272
|
* Same as `--tsconfig` command line argument.
|
|
280
273
|
*
|
|
@@ -288,9 +281,8 @@ module.exports = {
|
|
|
288
281
|
*/
|
|
289
282
|
ts: {
|
|
290
283
|
/**
|
|
291
|
-
* `
|
|
284
|
+
* `timing` and `git` are the same as in the root node.
|
|
292
285
|
*/
|
|
293
|
-
verbose: true,
|
|
294
286
|
timing: true,
|
|
295
287
|
git: true,
|
|
296
288
|
|
|
@@ -320,7 +312,7 @@ module.exports = {
|
|
|
320
312
|
*/
|
|
321
313
|
overrides: {
|
|
322
314
|
/**
|
|
323
|
-
* Rules that are applied to `linter-bundle/eslint.
|
|
315
|
+
* Rules that are applied to `linter-bundle/eslint.mjs`.
|
|
324
316
|
*/
|
|
325
317
|
general: {
|
|
326
318
|
'no-restricted-globals': {
|
|
@@ -374,7 +366,7 @@ module.exports = {
|
|
|
374
366
|
},
|
|
375
367
|
|
|
376
368
|
/**
|
|
377
|
-
* Rules that are applied to `linter-bundle/eslint/
|
|
369
|
+
* Rules that are applied to `linter-bundle/eslint/react.mjs`.
|
|
378
370
|
*/
|
|
379
371
|
react: {
|
|
380
372
|
'react/forbid-component-props': {
|
|
@@ -426,6 +418,11 @@ module.exports = {
|
|
|
426
418
|
* Configuration, specific to the `audit` command.
|
|
427
419
|
*/
|
|
428
420
|
md: {
|
|
421
|
+
/**
|
|
422
|
+
* `git` is the same as in the root node.
|
|
423
|
+
*/
|
|
424
|
+
git: true,
|
|
425
|
+
|
|
429
426
|
/**
|
|
430
427
|
* Same as `--include` command line argument.
|
|
431
428
|
*
|
|
@@ -438,13 +435,6 @@ module.exports = {
|
|
|
438
435
|
* Configuration, specific to the `audit` command.
|
|
439
436
|
*/
|
|
440
437
|
audit: {
|
|
441
|
-
/**
|
|
442
|
-
* `verbose`, `timing` and `git` are the same as in the root node.
|
|
443
|
-
*/
|
|
444
|
-
verbose: true,
|
|
445
|
-
timing: true,
|
|
446
|
-
git: true,
|
|
447
|
-
|
|
448
438
|
/**
|
|
449
439
|
* Same as `--min-severity` command line argument.
|
|
450
440
|
*
|
|
@@ -465,12 +455,17 @@ module.exports = {
|
|
|
465
455
|
*/
|
|
466
456
|
files: {
|
|
467
457
|
/**
|
|
468
|
-
* `
|
|
458
|
+
* `git` is the same as in the root node.
|
|
469
459
|
*/
|
|
470
|
-
verbose: true,
|
|
471
|
-
timing: true,
|
|
472
460
|
git: true,
|
|
473
461
|
|
|
462
|
+
/**
|
|
463
|
+
* Same as `--include` command line argument.
|
|
464
|
+
*
|
|
465
|
+
* @type {string[]}
|
|
466
|
+
*/
|
|
467
|
+
include: ['./included/*.ts'],
|
|
468
|
+
|
|
474
469
|
/**
|
|
475
470
|
* Array of restrictions for different base paths.
|
|
476
471
|
*
|
|
@@ -633,10 +628,7 @@ This can be done by adding these options to your `.vscode/settings.json`:
|
|
|
633
628
|
{
|
|
634
629
|
"eslint.nodePath": "./node_modules/linter-bundle/node_modules/eslint",
|
|
635
630
|
"eslint.options": {
|
|
636
|
-
"overrideConfigFile": "
|
|
637
|
-
"resolvePluginsRelativeTo": "./node_modules/linter-bundle",
|
|
638
|
-
"rulePaths": ["./node_modules/linter-bundle/eslint/rules"],
|
|
639
|
-
"reportUnusedDisableDirectives": "error",
|
|
631
|
+
"overrideConfigFile": "./eslint.config.mjs"
|
|
640
632
|
}
|
|
641
633
|
}
|
|
642
634
|
```
|
|
@@ -719,7 +711,3 @@ If you get such an error message:
|
|
|
719
711
|
the problem is most likely, that your `tsconfig.json` does not cover your JavaScript files and that you don't have a `jsconfig.json` file in your root directory. This is required by the `@typescript-eslint` to use TypeScript for linting of JavaScript files.
|
|
720
712
|
|
|
721
713
|
To solve this problem, either `"include"` your JavaScript files in your `tsconfig.json` (don't forget to set the compiler option `"checkJs"` to `true`) or create a `jsconfig.json` file in your root directory (this can be a copy of your `tsconfig.json` with an `"include"` of your JavaScript files).
|
|
722
|
-
|
|
723
|
-
### In VSCode, in every file, the first line shows the error `Definition for rule "no-unnecessary-typeof" was not found. eslint(no-unnecessary-typeof)`
|
|
724
|
-
|
|
725
|
-
Please ensure that you've added the configuration options as described above ("VSCode setup" > "ESLint").
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Settings for Gatsby-based projects.
|
|
3
|
+
*
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export default [
|
|
7
|
+
{
|
|
8
|
+
files: ['**/*.ts', '**/*.tsx'],
|
|
9
|
+
rules: {
|
|
10
|
+
/**
|
|
11
|
+
* eslint
|
|
12
|
+
* @see https://eslint.org/docs/rules/
|
|
13
|
+
*/
|
|
14
|
+
'no-restricted-imports': ['error', {
|
|
15
|
+
paths: [{
|
|
16
|
+
name: '@reach/router',
|
|
17
|
+
importNames: ['useNavigate'],
|
|
18
|
+
message: 'Use "import { navigate } from \'gatsby\';" instead of "const navigate = useNavigate();"'
|
|
19
|
+
}]
|
|
20
|
+
}],
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* typescript-eslint
|
|
24
|
+
* @see https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules
|
|
25
|
+
*/
|
|
26
|
+
'@typescript-eslint/no-confusing-void-expression': 'off', // @todo Conflicts with graphql-template strings
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* eslint-plugin-import
|
|
30
|
+
* @see https://github.com/import-js/eslint-plugin-import
|
|
31
|
+
*/
|
|
32
|
+
'import/no-unresolved': ['error', { caseSensitiveStrict: true, ignore: ['@reach/router'] }],
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* eslint-plugin-unicorn
|
|
36
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
37
|
+
*/
|
|
38
|
+
'unicorn/string-content': 'off' // Breaks code (e.g. imports with `...` in Next.js or GraphQL template strings)
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
files: ['**/*.tsx'],
|
|
43
|
+
settings: {
|
|
44
|
+
linkComponents: [
|
|
45
|
+
{ name: 'Link', linkAttribute: 'to' }
|
|
46
|
+
]
|
|
47
|
+
},
|
|
48
|
+
rules: {
|
|
49
|
+
/**
|
|
50
|
+
* eslint-plugin-unicorn
|
|
51
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
52
|
+
*/
|
|
53
|
+
'unicorn/filename-case': ['off', { // Disabled in favour of the linter-bundle `files` task
|
|
54
|
+
cases: {
|
|
55
|
+
camelCase: true,
|
|
56
|
+
pascalCase: true
|
|
57
|
+
},
|
|
58
|
+
ignore: [
|
|
59
|
+
/([A-Za-z0-9]?[a-z0-9]+)*[A-Z]{2,4}([A-Za-z0-9]?[a-z0-9]+)*/u // Up to 4 Characters can be upper-case in a row (e.g. in `prepareDOM` or `SVGIcon`)
|
|
60
|
+
]
|
|
61
|
+
}]
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
files: ['src/pages/*.tsx'],
|
|
66
|
+
rules: {
|
|
67
|
+
/**
|
|
68
|
+
* eslint-plugin-import
|
|
69
|
+
* @see https://github.com/import-js/eslint-plugin-import
|
|
70
|
+
*/
|
|
71
|
+
'import/no-default-export': 'off',
|
|
72
|
+
'import/no-unused-modules': ['error', { missingExports: true }],
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* eslint-plugin-unicorn
|
|
76
|
+
* @see https://github.com/sindresorhus/eslint-plugin-unicorn
|
|
77
|
+
*/
|
|
78
|
+
'unicorn/filename-case': ['off', { // Disabled in favour of the linter-bundle `files` task
|
|
79
|
+
cases: {
|
|
80
|
+
kebabCase: true
|
|
81
|
+
}
|
|
82
|
+
}]
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
files: ['gatsby-browser.js'],
|
|
87
|
+
rules: {
|
|
88
|
+
/**
|
|
89
|
+
* eslint-plugin-n
|
|
90
|
+
* @see https://github.com/eslint-community/eslint-plugin-n
|
|
91
|
+
*/
|
|
92
|
+
'n/no-unsupported-features/es-syntax': 'off'
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
];
|