linter-bundle 5.1.0 → 6.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 +2 -0
- package/CHANGELOG.md +62 -1
- package/README.md +5 -3
- package/TODO.md +5 -0
- package/eslint/index.cjs +6 -3
- package/eslint/overrides-javascript.cjs +1 -1
- package/eslint/overrides-jest.cjs +1 -0
- package/eslint/overrides-jsdoc.cjs +1 -0
- package/eslint/rules/no-global-undefined-check.js +5 -3
- package/eslint/rules/no-unnecessary-typeof.js +26 -24
- package/eslint/rules/restricted-filenames.js +3 -1
- package/helper/ensure-type.cjs +2 -2
- package/helper/get-git-files.js +1 -1
- package/helper/get-outdated-dependencies.js +1 -1
- package/helper/get-outdated-overrides.js +1 -1
- package/helper/get-stylelint-path.js +1 -1
- package/helper/is-npm-or-yarn.js +1 -1
- package/helper/linter-bundle-config.js +22 -7
- package/helper/run-process.js +3 -3
- package/lint.js +31 -35
- package/package.json +27 -26
- package/stylelint/index.cjs +89 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/LICENSE +20 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/LICENSE +9 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/index.cjs +122 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/selectors.cjs +327 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/README.md +110 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/index.cjs +66 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/README.md +117 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/index.cjs +55 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/README.md +63 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/index.cjs +87 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/README.md +50 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/index.cjs +70 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/atRuleNameSpaceChecker.cjs +56 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/README.md +238 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/index.cjs +130 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/README.md +196 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/index.cjs +154 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/README.md +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/index.cjs +133 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/README.md +174 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/index.cjs +111 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/README.md +138 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/index.cjs +184 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/README.md +191 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/index.cjs +118 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/README.md +218 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/index.cjs +141 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/README.md +58 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/index.cjs +95 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/README.md +72 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.cjs +95 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/README.md +67 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/index.cjs +96 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/README.md +141 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/index.cjs +109 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/README.md +120 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/index.cjs +75 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/README.md +147 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/index.cjs +97 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/README.md +130 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/index.cjs +106 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/README.md +108 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/index.cjs +147 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/README.md +78 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/index.cjs +99 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/README.md +111 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/index.cjs +75 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/README.md +72 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/index.cjs +74 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declarationBangSpaceChecker.cjs +63 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declarationColonSpaceChecker.cjs +58 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/findMediaOperator.cjs +32 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/README.md +113 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/index.cjs +61 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/README.md +129 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/index.cjs +61 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/README.md +144 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/index.cjs +62 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/README.md +144 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/index.cjs +62 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/README.md +78 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/index.cjs +115 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/README.md +144 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/index.cjs +282 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/README.md +140 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/index.cjs +182 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/README.md +80 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/index.cjs +198 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/functionCommaSpaceChecker.cjs +125 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/functionCommaSpaceFix.cjs +51 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/README.md +339 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/index.cjs +743 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/README.md +21 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/index.cjs +132 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/README.md +116 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/index.cjs +225 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/README.md +151 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/index.cjs +200 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/README.md +72 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/index.cjs +91 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/README.md +72 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/index.cjs +91 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/README.md +108 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/index.cjs +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/README.md +62 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/index.cjs +112 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/README.md +72 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/index.cjs +109 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/README.md +72 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/index.cjs +109 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/README.md +113 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/index.cjs +97 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/README.md +111 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/index.cjs +49 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/README.md +136 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/index.cjs +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/README.md +136 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/index.cjs +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/mediaFeatureColonSpaceChecker.cjs +54 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/mediaQueryListCommaWhitespaceChecker.cjs +73 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/README.md +34 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/index.cjs +63 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/README.md +79 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/index.cjs +302 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/README.md +78 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/index.cjs +246 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/README.md +34 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/index.cjs +62 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/README.md +74 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/index.cjs +197 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/README.md +40 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/index.cjs +139 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/README.md +192 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/index.cjs +95 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/README.md +112 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/index.cjs +214 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/README.md +162 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/index.cjs +109 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/README.md +162 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/index.cjs +88 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/README.md +78 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/index.cjs +67 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/README.md +78 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/index.cjs +67 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/README.md +40 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/index.cjs +95 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/README.md +120 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/index.cjs +126 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/README.md +112 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/index.cjs +101 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/README.md +110 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/index.cjs +92 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/README.md +110 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/index.cjs +92 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/README.md +103 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/index.cjs +74 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/README.md +108 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/index.cjs +104 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/README.md +62 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/index.cjs +162 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/README.md +128 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/index.cjs +90 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorAttributeOperatorSpaceChecker.cjs +95 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorCombinatorSpaceChecker.cjs +113 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorListCommaWhitespaceChecker.cjs +64 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/README.md +130 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/index.cjs +256 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/README.md +41 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/index.cjs +67 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/README.md +126 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/index.cjs +133 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/README.md +102 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/index.cjs +107 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/README.md +100 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/index.cjs +49 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/README.md +136 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/index.cjs +94 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/README.md +136 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/index.cjs +94 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/README.md +121 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/index.cjs +68 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/valueListCommaWhitespaceChecker.cjs +74 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/LICENSE +13 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/index.cjs +216 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/addEmptyLineAfter.cjs +30 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/hasEmptyBlock.cjs +14 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/nextNonCommentNode.cjs +21 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/removeEmptyLinesAfter.cjs +16 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/whitespaceChecker.cjs +361 -0
- package/stylelint/plugins/stylelint-selector-no-empty.js +8 -8
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +4 -4
- package/stylelint/plugins/stylelint-high-performance-animation.js +0 -276
- package/stylelint/plugins/stylelint-stylistic.js +0 -188
package/.linter-bundle.js
CHANGED
|
@@ -9,6 +9,7 @@ const snippets = {
|
|
|
9
9
|
};
|
|
10
10
|
|
|
11
11
|
export default {
|
|
12
|
+
verbose: true,
|
|
12
13
|
timing: true,
|
|
13
14
|
files: {
|
|
14
15
|
restrictions: [
|
|
@@ -27,6 +28,7 @@ export default {
|
|
|
27
28
|
'node_modules/**',
|
|
28
29
|
'stylelint/index.cjs',
|
|
29
30
|
`stylelint/plugins/stylelint-${snippets.kebabCase}.js`,
|
|
31
|
+
`stylelint/plugins/stylelint-15.11.0-stylistic/**/{${snippets.camelCase}.cjs,README.md,LICENSE}`,
|
|
30
32
|
'.editorconfig',
|
|
31
33
|
'.eslintrc.cjs',
|
|
32
34
|
'.gitattributes',
|
package/CHANGELOG.md
CHANGED
|
@@ -6,7 +6,68 @@ 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/v6.0.0...HEAD)
|
|
10
|
+
|
|
11
|
+
## [6.0.0] - 2024-01-21
|
|
12
|
+
|
|
13
|
+
### Added
|
|
14
|
+
|
|
15
|
+
- [eslint] Make use of new [`@typescript-eslint/no-useless-empty-export`](https://typescript-eslint.io/rules/no-useless-empty-export) rule
|
|
16
|
+
- [eslint] Make use of new [`@typescript-eslint/no-unsafe-unary-minus`](https://typescript-eslint.io/rules/no-unsafe-unary-minus/) rule
|
|
17
|
+
- [eslint] Make use of new [`no-object-constructor`](https://eslint.org/docs/latest/rules/no-object-constructor) rule
|
|
18
|
+
- [eslint] Make use of new [`unicorn/no-unnecessary-polyfills`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/no-unnecessary-polyfills.md) rule
|
|
19
|
+
- [markdownlint] Make use of new [`MD054`/link-image-style](https://github.com/DavidAnson/markdownlint/blob/main/doc/md054.md) rule
|
|
20
|
+
- [eslint/overrides-jest] Make use of new [`jest/no-confusing-set-time`](https://github.com/jest-community/eslint-plugin-jest/blob/main/docs/rules/no-confusing-set-timeout.md) rule
|
|
21
|
+
- [eslint/overrides-jsdoc] Make use of [`jsdoc/informative-docs`](https://github.com/gajus/eslint-plugin-jsdoc/blob/main/docs/rules/informative-docs.md) rule
|
|
22
|
+
- [stylelint] Make use of new [`lightness-notation`](https://stylelint.io/user-guide/rules/lightness-notation/) rule with option "percentage"
|
|
23
|
+
- [stylelint] Make use of new [`scss/at-root-no-redundant`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-root-no-redundant/README.md) rule
|
|
24
|
+
- [stylelint] Make use of new [`scss/property-no-unknown`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/property-no-unknown/README.md) rule, replacing [`property-no-unknown`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/property-no-unknown/) rule
|
|
25
|
+
- [stylelint] Make use of new [`scss/function-calculation-no-interpolation`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/function-calculation-no-interpolation/README.md) rule
|
|
26
|
+
- [stylelint] Added, but disabled new [`scss/block-no-redundant-nesting`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/block-no-redundant-nesting/README.md) rule
|
|
27
|
+
- [stylelint] Added, but disabled new [`scss/load-no-partial-leading-underscore`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/load-no-partial-leading-underscore/README.md) rule
|
|
28
|
+
- [stylelint] Added, but disabled [`scss/at-use-no-redundant-alias`](https://github.com/stylelint-scss/stylelint-scss/blob/master/src/rules/at-use-no-redundant-alias/README.md) rule
|
|
29
|
+
|
|
30
|
+
### Fixed
|
|
31
|
+
|
|
32
|
+
- [general] Removed '--verbose' argument for `tsc` and `markdownlint`, which don't support it
|
|
33
|
+
- [general] Show errors in linter-bundle configuration file
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
|
|
37
|
+
- [general] Drop support for Node.js version less than v18.12.0 as `stylelint@16.0.0` doesn't support them anymore
|
|
38
|
+
- [eslint] Updated `@typescript-eslint` from `6.5.0` to `6.19.0`
|
|
39
|
+
- [eslint] Updated `eslint` from `8.48.0` to `8.56.0`
|
|
40
|
+
- [eslint] Updated `eslint-import-resolver-typescript` from `3.6.0` to `3.6.1`
|
|
41
|
+
- [eslint] Updated `eslint-import-resolver-webpack` from `0.13.7` to `0.13.8`
|
|
42
|
+
- [eslint] Updated `eslint-plugin-import` from `2.28.1` to `2.29.1`
|
|
43
|
+
- [eslint] Updated `eslint-plugin-jest` from `27.2.3` to `27.6.3`
|
|
44
|
+
- [eslint] Updated `eslint-plugin-jsdoc` from `46.5.1` to `48.0.2`
|
|
45
|
+
- [eslint] Updated `eslint-plugin-jsx-a11y` from `6.7.1` to `6.8.0`
|
|
46
|
+
- [eslint] Updated `eslint-plugin-n` from `16.0.2` to `16.6.2`
|
|
47
|
+
- [eslint] Updated `eslint-plugin-unicorn` from `48.0.1` to `50.0.1`
|
|
48
|
+
- [markdownlint] Updated `markdownlint-cli` from `0.36.0` to `0.38.0`
|
|
49
|
+
- [stylelint] Updated `postcss-scss` from `4.0.7` to `4.0.9`
|
|
50
|
+
- [stylelint] Updated `stylelint` from `15.10.3` to `16.2.0`
|
|
51
|
+
- [stylelint] Updated `stylelint-declaration-block-no-ignored-properties` from `2.7.0` to `2.8.0`
|
|
52
|
+
- [stylelint] Updated `stylelint-order` from `6.0.3` to `6.0.4`
|
|
53
|
+
- [stylelint] Updated `stylelint-scss` from `5.1.0` to `6.0.0`
|
|
54
|
+
- [stylelint] Updated `stylelint-use-logical-spec` from `5.0.0` to `5.0.1`
|
|
55
|
+
- [stylelint] Forked 73 stylistic rules from `stylelint@15.11.0` which have been removed in `stylelint@16.0.0`
|
|
56
|
+
- [audit] Updated `better-npm-audit` from `1.9.1` to `3.7.3`
|
|
57
|
+
- [audit] Updated `improved-yarn-audit` from `2.3.3` to `3.0.0`
|
|
58
|
+
- [eslint] Enable `ignoreOverrideMethods` and `ignoreClassesThatImplementAnInterface` of [`@typescript-eslint/class-methods-use-this`](https://typescript-eslint.io/rules/class-methods-use-this/) rule
|
|
59
|
+
- [eslint] Enable `includeTypes` option of [`import/no-extraneous-dependencies`](https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-extraneous-dependencies.md) rule
|
|
60
|
+
- [eslint/overrides-javascript] Activated rule [`unicorn/prefer-module`](https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-module.md) rule
|
|
61
|
+
- [stylelint] Re-use [`stylelint-high-performance-animation`](https://www.npmjs.com/package/stylelint-high-performance-animation) instead of the fork, as it seems to be maintained again
|
|
62
|
+
|
|
63
|
+
### Removed
|
|
64
|
+
|
|
65
|
+
- [eslint] Remove deprecated `no-new-object` rule
|
|
66
|
+
- [markdownlint] Update removed the deprecated `MD002`/`MD006` rules
|
|
67
|
+
- [markdownlint] Update removed rule aliases for "header"
|
|
68
|
+
- [stylelint] Removed deprecated `scss/at-import-no-partial-leading-underscore` rule
|
|
69
|
+
|
|
70
|
+
[Show all code changes](https://github.com/jens-duttke/linter-bundle/compare/v5.1.0...v6.0.0)
|
|
10
71
|
|
|
11
72
|
## [5.1.0] - 2023-09-03
|
|
12
73
|
|
package/README.md
CHANGED
|
@@ -44,13 +44,15 @@ Beside that, the following additional rules are part of this bundle:
|
|
|
44
44
|
### stylelint
|
|
45
45
|
|
|
46
46
|
- [stylelint-declaration-block-no-ignored-properties](https://www.npmjs.com/package/stylelint-declaration-block-no-ignored-properties)
|
|
47
|
-
- [stylelint-high-performance-animation](https://www.npmjs.com/package/stylelint-high-performance-animation)
|
|
47
|
+
- [stylelint-high-performance-animation](https://www.npmjs.com/package/stylelint-high-performance-animation)
|
|
48
48
|
- [stylelint-order](https://www.npmjs.com/package/stylelint-order)
|
|
49
49
|
- [stylelint-scss](https://www.npmjs.com/package/stylelint-scss)
|
|
50
50
|
- [stylelint-selector-no-empty](https://www.npmjs.com/package/stylelint-selector-no-empty) (Forked version)
|
|
51
51
|
- [stylelint-selector-tag-no-without-class](https://www.npmjs.com/package/stylelint-selector-tag-no-without-class) (Forked version)
|
|
52
52
|
- [stylelint-use-logical-spec](https://www.npmjs.com/package/stylelint-use-logical-spec)
|
|
53
53
|
|
|
54
|
+
Beside that [73 stylistic rules](https://github.com/jens-duttke/linter-bundle/tree/main/stylelint/plugins/stylelint-15.11.0-stylistic/rules) has been forked from `stylelint@15.11.0`, which have been removed in `stylelint@16.0.0`, are part of this bundle.
|
|
55
|
+
|
|
54
56
|
### Previously used, but now unmaintained plugins
|
|
55
57
|
|
|
56
58
|
Unfortunately a couple of previously used plugins are not regularly maintained or depend on unmaintained third-party code which blocks them from updating, so they don't provide updates for the major releases of the linters (ESLint and Stylelint).
|
|
@@ -62,7 +64,7 @@ If these plugins are maintained again, the plugins will also be used again.
|
|
|
62
64
|
|
|
63
65
|
## Install
|
|
64
66
|
|
|
65
|
-
Ensure you are using atleast Node.js version
|
|
67
|
+
Ensure you are using atleast Node.js version 18.2.0.
|
|
66
68
|
|
|
67
69
|
```sh
|
|
68
70
|
npm install linter-bundle --save-dev
|
|
@@ -561,7 +563,7 @@ Will execute:
|
|
|
561
563
|
eslint "./**/*.{js,cjs,mjs,jsx,ts,cts,mts,tsx}" --format unix
|
|
562
564
|
```
|
|
563
565
|
|
|
564
|
-
Additionally, the environment variable `TIMING` is set to `10
|
|
566
|
+
Additionally, the environment variable `TIMING` is set to `10`, to show timing information about the 10 slowest rules.
|
|
565
567
|
|
|
566
568
|
#### Optional command line arguments for `lint ts`
|
|
567
569
|
|
package/TODO.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# @todo
|
|
2
2
|
|
|
3
|
+
- Aktuell sind die Versionen von den Audit-Tools hardcodiert in der lint.js hinterlegt:
|
|
4
|
+
'better-npm-audit@3.7.3',
|
|
5
|
+
'improved-yarn-audit@3.0.0',
|
|
6
|
+
Das sollte irgendwo hinterlegt werden, so z.B. check-outdated drauf zugreifen kann. (z.B. die optionalDependencies? Sind diese nach dem regulären Installieren noch vorhanden und lassen sich entsprechend auslesen? Werden diese von check-outdated geprüft?)
|
|
7
|
+
|
|
3
8
|
- Timing funktioniert nicht - siehe HexEd.it-core
|
|
4
9
|
|
|
5
10
|
- Wie erreichen wir auto-completion in der .linter-bundle.js datei?
|
package/eslint/index.cjs
CHANGED
|
@@ -261,12 +261,12 @@ module.exports = {
|
|
|
261
261
|
'no-nested-ternary': 'error',
|
|
262
262
|
'no-new-func': 'error',
|
|
263
263
|
'no-new-native-nonconstructor': 'error',
|
|
264
|
-
'no-new-object': 'error',
|
|
265
264
|
'no-new-symbol': 'error',
|
|
266
265
|
'no-new-wrappers': 'error',
|
|
267
266
|
'no-new': 'error',
|
|
268
267
|
'no-nonoctal-decimal-escape': 'error',
|
|
269
268
|
'no-obj-calls': 'error',
|
|
269
|
+
'no-object-constructor': 'error',
|
|
270
270
|
'no-octal-escape': 'error',
|
|
271
271
|
'no-octal': 'error',
|
|
272
272
|
'no-param-reassign': 'off', // Parameter reassignment used wisely makes the code more readable
|
|
@@ -423,7 +423,7 @@ module.exports = {
|
|
|
423
423
|
}],
|
|
424
424
|
'@typescript-eslint/brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
|
|
425
425
|
'@typescript-eslint/class-literal-property-style': 'error',
|
|
426
|
-
'@typescript-eslint/class-methods-use-this': ['error', { exceptMethods: ['componentDidMount', 'componentDidUpdate', 'componentWillUnmount', 'shouldComponentUpdate'] }],
|
|
426
|
+
'@typescript-eslint/class-methods-use-this': ['error', { exceptMethods: ['componentDidMount', 'componentDidUpdate', 'componentWillUnmount', 'shouldComponentUpdate'], ignoreOverrideMethods: true, ignoreClassesThatImplementAnInterface: true }],
|
|
427
427
|
'@typescript-eslint/comma-dangle': ['error', { generics: 'ignore' }],
|
|
428
428
|
'@typescript-eslint/comma-spacing': 'error',
|
|
429
429
|
'@typescript-eslint/consistent-generic-constructors': 'error',
|
|
@@ -730,10 +730,12 @@ module.exports = {
|
|
|
730
730
|
'@typescript-eslint/no-unsafe-enum-comparison': 'error',
|
|
731
731
|
'@typescript-eslint/no-unsafe-member-access': 'error',
|
|
732
732
|
'@typescript-eslint/no-unsafe-return': 'error',
|
|
733
|
+
'@typescript-eslint/no-unsafe-unary-minus': 'error',
|
|
733
734
|
'@typescript-eslint/no-unused-expressions': 'error',
|
|
734
735
|
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_' }],
|
|
735
736
|
'@typescript-eslint/no-use-before-define': ['error', { functions: false }],
|
|
736
737
|
'@typescript-eslint/no-useless-constructor': 'error',
|
|
738
|
+
'@typescript-eslint/no-useless-empty-export': 'error',
|
|
737
739
|
'@typescript-eslint/no-var-requires': 'error',
|
|
738
740
|
'@typescript-eslint/non-nullable-type-assertion-style': 'off', // Conflicts with `no-non-null-assertion`, which we prefer
|
|
739
741
|
'@typescript-eslint/object-curly-spacing': ['error', 'always'],
|
|
@@ -832,7 +834,7 @@ module.exports = {
|
|
|
832
834
|
'import/no-duplicates': 'error',
|
|
833
835
|
'import/no-dynamic-require': 'error',
|
|
834
836
|
'import/no-empty-named-blocks': 'error',
|
|
835
|
-
'import/no-extraneous-dependencies': 'error',
|
|
837
|
+
'import/no-extraneous-dependencies': ['error', { includeTypes: true }],
|
|
836
838
|
'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!
|
|
837
839
|
allow: [
|
|
838
840
|
'workbox-window/utils/WorkboxEvent'
|
|
@@ -978,6 +980,7 @@ module.exports = {
|
|
|
978
980
|
'unicorn/no-this-assignment': 'error',
|
|
979
981
|
'unicorn/no-typeof-undefined': 'error',
|
|
980
982
|
'unicorn/no-unnecessary-await': 'error',
|
|
983
|
+
'unicorn/no-unnecessary-polyfills': 'error',
|
|
981
984
|
'unicorn/no-unreadable-array-destructuring': 'error',
|
|
982
985
|
'unicorn/no-unreadable-iife': 'error',
|
|
983
986
|
'unicorn/no-unused-properties': 'error',
|
|
@@ -99,7 +99,7 @@ module.exports = {
|
|
|
99
99
|
}
|
|
100
100
|
}],
|
|
101
101
|
'unicorn/no-process-exit': 'off', // n/no-process-exit
|
|
102
|
-
'unicorn/prefer-module': '
|
|
102
|
+
'unicorn/prefer-module': 'error',
|
|
103
103
|
'unicorn/prefer-node-protocol': 'off', // @todo Requires Node.js v16. Activate in 2025
|
|
104
104
|
'unicorn/prevent-abbreviations': ['error', { ignore: ['args', 'dev', 'env', 'i', 'j', 'i18n', 'pkg', 'ref', 'Ref', 'req', 'res', 'setupDevServerMiddleware'] }],
|
|
105
105
|
'unicorn/text-encoding-identifier-case': 'off'
|
|
@@ -70,6 +70,7 @@ module.exports = {
|
|
|
70
70
|
'jest/no-commented-out-tests': 'error',
|
|
71
71
|
'jest/no-conditional-expect': 'error',
|
|
72
72
|
'jest/no-conditional-in-test': 'error',
|
|
73
|
+
'jest/no-confusing-set-time': 'error',
|
|
73
74
|
'jest/no-deprecated-functions': 'error',
|
|
74
75
|
'jest/no-disabled-tests': 'error',
|
|
75
76
|
'jest/no-done-callback': 'error',
|
|
@@ -35,6 +35,7 @@ module.exports = {
|
|
|
35
35
|
'jsdoc/empty-tags': 'error',
|
|
36
36
|
'jsdoc/implements-on-classes': 'error',
|
|
37
37
|
'jsdoc/imports-as-dependencies': 'off', // @todo Doesn't cover `peerDependencies` yet. As of v46.2.5 it should cover Node.js modules (like `child_process`), which must be checked, before activation.
|
|
38
|
+
'jsdoc/informative-docs': 'error',
|
|
38
39
|
'jsdoc/match-description': 'error',
|
|
39
40
|
'jsdoc/match-name': 'off',
|
|
40
41
|
'jsdoc/multiline-blocks': ['error', { noSingleLineBlocks: true, singleLineTags: ['lends', 'type', 'typedef'], noFinalLineText: false }],
|
|
@@ -4,6 +4,8 @@
|
|
|
4
4
|
* @see https://www.joshwcomeau.com/react/the-perils-of-rehydration/
|
|
5
5
|
*/
|
|
6
6
|
|
|
7
|
+
/* eslint-disable unicorn/prefer-module -- For ESLint, we still need to rely on CommonJS modules */
|
|
8
|
+
|
|
7
9
|
const DISALLOWED_OBJECTS = new Set(['globalThis', 'window', 'self']);
|
|
8
10
|
|
|
9
11
|
/**
|
|
@@ -58,8 +60,8 @@ module.exports = {
|
|
|
58
60
|
/**
|
|
59
61
|
* Get the name (identifier) of a global scope of an BinaryExpression operator.
|
|
60
62
|
*
|
|
61
|
-
* @param {import('estree').Expression} node - The node to check
|
|
62
|
-
* @returns {string | null} Returns the name of the `node`, or null if not compared with a global scope identifier
|
|
63
|
+
* @param {import('estree').Expression} node - The node to check
|
|
64
|
+
* @returns {string | null} Returns the name of the `node`, or null if not compared with a global scope identifier
|
|
63
65
|
*/
|
|
64
66
|
function getExpressionValue (node) {
|
|
65
67
|
if (node.type === 'UnaryExpression' && node.operator === 'typeof' && node.argument.type === 'Identifier' && DISALLOWED_OBJECTS.has(node.argument.name)) {
|
|
@@ -73,7 +75,7 @@ function getExpressionValue (node) {
|
|
|
73
75
|
* Check if a given `node` is a literal expression consisting of the text "undefined".
|
|
74
76
|
*
|
|
75
77
|
* @param {import('estree').Expression} node - The node to check
|
|
76
|
-
* @returns {boolean} `true` if the node is a literal expression consisting of the text "undefined", otherwise `false
|
|
78
|
+
* @returns {boolean} `true` if the node is a literal expression consisting of the text "undefined", otherwise `false`
|
|
77
79
|
*/
|
|
78
80
|
function checkLiteral (node) {
|
|
79
81
|
return (
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @file ESLint rule which ensures that a `typeof` operant has more than one type in TypeScript, to prevent unnecessary checks of types at runtime.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
/* eslint-disable unicorn/prefer-module -- For ESLint, we still need to rely on CommonJS modules */
|
|
6
|
+
|
|
5
7
|
/** @typedef {ts.Type & { intrinsicName?: string; types?: ts.Type[]; objectFlags?: ts.ObjectFlags; }} Type */
|
|
6
8
|
|
|
7
9
|
const ts = require('typescript');
|
|
@@ -69,9 +71,9 @@ module.exports = {
|
|
|
69
71
|
/**
|
|
70
72
|
* Check if the number of types equals one, and returns the type.
|
|
71
73
|
*
|
|
72
|
-
* @param {ts.TypeChecker} checker - TypeScript type checker
|
|
73
|
-
* @param {Type} type - TypeScript type node
|
|
74
|
-
* @returns {string | null} Type as string match the `typeof` string, or `null` if it's not a primitive type
|
|
74
|
+
* @param {ts.TypeChecker} checker - TypeScript type checker
|
|
75
|
+
* @param {Type} type - TypeScript type node
|
|
76
|
+
* @returns {string | null} Type as string match the `typeof` string, or `null` if it's not a primitive type
|
|
75
77
|
*/
|
|
76
78
|
function getSingleType (checker, type) {
|
|
77
79
|
if (isAnyOrUnknown(type)) {
|
|
@@ -100,9 +102,9 @@ function getSingleType (checker, type) {
|
|
|
100
102
|
/**
|
|
101
103
|
* Converts a TypeScript type into a `typeof` compatible string, or `null` if it's not a primitive type.
|
|
102
104
|
*
|
|
103
|
-
* @param {ts.TypeChecker} checker - TypeScript type checker
|
|
104
|
-
* @param {Type} type - TypeScript type node
|
|
105
|
-
* @returns {string | null} Type as string match the `typeof` string, or `null` if it's not a primitive type
|
|
105
|
+
* @param {ts.TypeChecker} checker - TypeScript type checker
|
|
106
|
+
* @param {Type} type - TypeScript type node
|
|
107
|
+
* @returns {string | null} Type as string match the `typeof` string, or `null` if it's not a primitive type
|
|
106
108
|
*/
|
|
107
109
|
function getTypeString (checker, type) {
|
|
108
110
|
if (isAnyOrUnknown(type)) {
|
|
@@ -130,8 +132,8 @@ function getTypeString (checker, type) {
|
|
|
130
132
|
/**
|
|
131
133
|
* Check if the type is either `any` or `unknown`, which represents multiple types.
|
|
132
134
|
*
|
|
133
|
-
* @param {ts.Type} type - TypeScript type node
|
|
134
|
-
* @returns {boolean} Returns `true` if the type is either `any` or `unknown`, or an object which is based on `unknown
|
|
135
|
+
* @param {ts.Type} type - TypeScript type node
|
|
136
|
+
* @returns {boolean} Returns `true` if the type is either `any` or `unknown`, or an object which is based on `unknown`
|
|
135
137
|
*/
|
|
136
138
|
function isAnyOrUnknown (type) {
|
|
137
139
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition -- `symbol` on Object is `undefined` for `Omit<unknown, 'undefined'>`
|
|
@@ -141,8 +143,8 @@ function isAnyOrUnknown (type) {
|
|
|
141
143
|
/**
|
|
142
144
|
* Checks if the given `type` is a `string`.
|
|
143
145
|
*
|
|
144
|
-
* @param {Type} type - TypeScript type node
|
|
145
|
-
* @returns {boolean} Returns `true` if the type is a `string
|
|
146
|
+
* @param {Type} type - TypeScript type node
|
|
147
|
+
* @returns {boolean} Returns `true` if the type is a `string`
|
|
146
148
|
*/
|
|
147
149
|
function isString (type) {
|
|
148
150
|
return [ts.TypeFlags.String, ts.TypeFlags.StringLiteral, ts.TypeFlags.StringMapping].includes(type.flags);
|
|
@@ -151,8 +153,8 @@ function isString (type) {
|
|
|
151
153
|
/**
|
|
152
154
|
* Checks if the given `type` is a `number`.
|
|
153
155
|
*
|
|
154
|
-
* @param {Type} type - TypeScript type node
|
|
155
|
-
* @returns {boolean} Returns `true` if the type is a `number
|
|
156
|
+
* @param {Type} type - TypeScript type node
|
|
157
|
+
* @returns {boolean} Returns `true` if the type is a `number`
|
|
156
158
|
*/
|
|
157
159
|
function isNumber (type) {
|
|
158
160
|
return [ts.TypeFlags.Number, ts.TypeFlags.NumberLiteral].includes(type.flags);
|
|
@@ -161,8 +163,8 @@ function isNumber (type) {
|
|
|
161
163
|
/**
|
|
162
164
|
* Checks if the given `type` is a `bigint`.
|
|
163
165
|
*
|
|
164
|
-
* @param {Type} type - TypeScript type node
|
|
165
|
-
* @returns {boolean} Returns `true` if the type is a `bigint
|
|
166
|
+
* @param {Type} type - TypeScript type node
|
|
167
|
+
* @returns {boolean} Returns `true` if the type is a `bigint`
|
|
166
168
|
*/
|
|
167
169
|
function isBigInt (type) {
|
|
168
170
|
return [ts.TypeFlags.BigInt, ts.TypeFlags.BigIntLiteral].includes(type.flags);
|
|
@@ -171,8 +173,8 @@ function isBigInt (type) {
|
|
|
171
173
|
/**
|
|
172
174
|
* Checks if the given `type` is a `boolean`.
|
|
173
175
|
*
|
|
174
|
-
* @param {Type} type - TypeScript type node
|
|
175
|
-
* @returns {boolean} Returns `true` if the type is a `boolean
|
|
176
|
+
* @param {Type} type - TypeScript type node
|
|
177
|
+
* @returns {boolean} Returns `true` if the type is a `boolean`
|
|
176
178
|
*/
|
|
177
179
|
function isBoolean (type) {
|
|
178
180
|
return [ts.TypeFlags.Boolean, ts.TypeFlags.BooleanLiteral].includes(type.flags);
|
|
@@ -181,8 +183,8 @@ function isBoolean (type) {
|
|
|
181
183
|
/**
|
|
182
184
|
* Checks if the given `type` is a `symbol`.
|
|
183
185
|
*
|
|
184
|
-
* @param {Type} type - TypeScript type node
|
|
185
|
-
* @returns {boolean} Returns `true` if the type is a `symbol
|
|
186
|
+
* @param {Type} type - TypeScript type node
|
|
187
|
+
* @returns {boolean} Returns `true` if the type is a `symbol`
|
|
186
188
|
*/
|
|
187
189
|
function isSymbol (type) {
|
|
188
190
|
return [ts.TypeFlags.ESSymbol, ts.TypeFlags.UniqueESSymbol].includes(type.flags);
|
|
@@ -191,8 +193,8 @@ function isSymbol (type) {
|
|
|
191
193
|
/**
|
|
192
194
|
* Checks if the given `type` is a `function`.
|
|
193
195
|
*
|
|
194
|
-
* @param {Type} type - TypeScript type node
|
|
195
|
-
* @returns {boolean} Returns `true` if the type is a `function
|
|
196
|
+
* @param {Type} type - TypeScript type node
|
|
197
|
+
* @returns {boolean} Returns `true` if the type is a `function`
|
|
196
198
|
*/
|
|
197
199
|
function isFunction (type) {
|
|
198
200
|
return (type.flags === ts.TypeFlags.Object && type.objectFlags === ts.ObjectFlags.Anonymous);
|
|
@@ -201,8 +203,8 @@ function isFunction (type) {
|
|
|
201
203
|
/**
|
|
202
204
|
* Checks if the given `type` is a `undefined`.
|
|
203
205
|
*
|
|
204
|
-
* @param {Type} type - TypeScript type node
|
|
205
|
-
* @returns {boolean} Returns `true` if the type is `undefined
|
|
206
|
+
* @param {Type} type - TypeScript type node
|
|
207
|
+
* @returns {boolean} Returns `true` if the type is `undefined`
|
|
206
208
|
*/
|
|
207
209
|
function isUndefined (type) {
|
|
208
210
|
return [ts.TypeFlags.Undefined].includes(type.flags);
|
|
@@ -213,8 +215,8 @@ function isUndefined (type) {
|
|
|
213
215
|
*
|
|
214
216
|
* We don't check `ts.TypeFlags.Object`, because for TypeScript Object seems to be the fallback for everything - even unknown types.
|
|
215
217
|
*
|
|
216
|
-
* @param {Type} type - TypeScript type node
|
|
217
|
-
* @returns {boolean} Returns `true` if the type is an `object
|
|
218
|
+
* @param {Type} type - TypeScript type node
|
|
219
|
+
* @returns {boolean} Returns `true` if the type is an `object`
|
|
218
220
|
*/
|
|
219
221
|
function isObject (type) {
|
|
220
222
|
return [ts.TypeFlags.Null].includes(type.flags);
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* @file ESLint rule which ensures that only files which match given glob patterns are part of your project.
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
/* eslint-disable unicorn/prefer-module -- For ESLint, we still need to rely on CommonJS modules */
|
|
6
|
+
|
|
5
7
|
const path = require('node:path');
|
|
6
8
|
|
|
7
9
|
const micromatch = require('micromatch');
|
|
@@ -87,7 +89,7 @@ module.exports = {
|
|
|
87
89
|
/**
|
|
88
90
|
* Add rule listener which reports the error.
|
|
89
91
|
*
|
|
90
|
-
* @returns {import('eslint').Rule.RuleListener} Returns a `Program` rule lister which reports the error
|
|
92
|
+
* @returns {import('eslint').Rule.RuleListener} Returns a `Program` rule lister which reports the error
|
|
91
93
|
*/
|
|
92
94
|
function report () {
|
|
93
95
|
return {
|
package/helper/ensure-type.cjs
CHANGED
|
@@ -9,8 +9,8 @@
|
|
|
9
9
|
*
|
|
10
10
|
* @public
|
|
11
11
|
* @template T
|
|
12
|
-
* @param {T} value - The value which should be checked
|
|
13
|
-
* @returns {T extends Array<any> ? T : []} Either the input array, or an empty array, if the input array is not an array
|
|
12
|
+
* @param {T} value - The value which should be checked
|
|
13
|
+
* @returns {T extends Array<any> ? T : []} Either the input array, or an empty array, if the input array is not an array
|
|
14
14
|
*/
|
|
15
15
|
function array (value) {
|
|
16
16
|
// @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`.
|
package/helper/get-git-files.js
CHANGED
|
@@ -15,7 +15,7 @@ let gitFiles;
|
|
|
15
15
|
* Returns a list of changed files based on Git.
|
|
16
16
|
*
|
|
17
17
|
* @public
|
|
18
|
-
* @returns {Promise<string[]>} The list of changed files
|
|
18
|
+
* @returns {Promise<string[]>} The list of changed files
|
|
19
19
|
*/
|
|
20
20
|
export async function getGitFiles () {
|
|
21
21
|
if (!gitFilesProcessPromise) {
|
|
@@ -17,7 +17,7 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
17
17
|
* Detects if installed versions of dependencies don't match to the required dependencies.
|
|
18
18
|
*
|
|
19
19
|
* @public
|
|
20
|
-
* @returns {Promise<Dependency[]>} An array of missing overrides (=wrong versions)
|
|
20
|
+
* @returns {Promise<Dependency[]>} An array of missing overrides (=wrong versions)
|
|
21
21
|
*/
|
|
22
22
|
export async function getOutdatedDependencies () {
|
|
23
23
|
const linterBundleDependencies = JSON.parse(await fs.readFile(path.resolve(dirname, '../package.json'), 'utf8')).dependencies;
|
|
@@ -17,7 +17,7 @@ const dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
|
17
17
|
* Detects outdated "overrides"/"resolutions" dependencies.
|
|
18
18
|
*
|
|
19
19
|
* @public
|
|
20
|
-
* @returns {Promise<{ overrides: Dependency[]; resolutions: Dependency[]; }>} Either the input array, or an empty array, if the input array is not an array
|
|
20
|
+
* @returns {Promise<{ overrides: Dependency[]; resolutions: Dependency[]; }>} Either the input array, or an empty array, if the input array is not an array
|
|
21
21
|
*/
|
|
22
22
|
export async function getOutdatedOverrides () {
|
|
23
23
|
const linterBundleDependencies = JSON.parse(await fs.readFile(path.resolve(dirname, '../package.json'), 'utf8')).dependencies;
|
|
@@ -12,7 +12,7 @@ const require = createRequire(import.meta.url);
|
|
|
12
12
|
* Returns if the project is using npm or yarn.
|
|
13
13
|
*
|
|
14
14
|
* @public
|
|
15
|
-
* @returns {Promise<string | null>} Return the path to the Stylelint CLI script, or `null` if it can't be found
|
|
15
|
+
* @returns {Promise<string | null>} Return the path to the Stylelint CLI script, or `null` if it can't be found
|
|
16
16
|
*/
|
|
17
17
|
export async function getStylelintPath () {
|
|
18
18
|
const stylelintLibPath = path.dirname(require.resolve('stylelint'));
|
package/helper/is-npm-or-yarn.js
CHANGED
|
@@ -9,7 +9,7 @@ import * as path from 'node:path';
|
|
|
9
9
|
* Returns if the project is using npm or yarn.
|
|
10
10
|
*
|
|
11
11
|
* @public
|
|
12
|
-
* @returns {Promise<'none' | 'npm' | 'yarn' | 'both'>} Returns which package manager name
|
|
12
|
+
* @returns {Promise<'none' | 'npm' | 'yarn' | 'both'>} Returns which package manager name
|
|
13
13
|
*/
|
|
14
14
|
export async function isNpmOrYarn () {
|
|
15
15
|
let npm = false;
|
|
@@ -16,20 +16,26 @@ export const linterBundleConfig = (
|
|
|
16
16
|
/**
|
|
17
17
|
* Load a config file if it exist.
|
|
18
18
|
*
|
|
19
|
-
* @param {string} fileName - The name of the config file
|
|
20
|
-
* @returns {Promise<import('./linter-bundle-config.js').LinterBundleConfig | undefined>}
|
|
19
|
+
* @param {string} fileName - The name of the config file in the current working directory
|
|
20
|
+
* @returns {Promise<import('./linter-bundle-config.js').LinterBundleConfig | undefined>} Either the file content for `undefined` if the file does not exist
|
|
21
21
|
* */
|
|
22
22
|
async function loadConfig (fileName) {
|
|
23
|
+
const filePath = path.join(process.cwd(), fileName);
|
|
24
|
+
|
|
25
|
+
if (!await fs.access(filePath, fs.constants.F_OK).then(() => true).catch(() => false)) {
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
|
|
23
29
|
try {
|
|
24
30
|
if (fileName.endsWith('.json')) {
|
|
25
|
-
const content = await fs.readFile(
|
|
31
|
+
const content = await fs.readFile(filePath, 'utf8');
|
|
26
32
|
|
|
27
33
|
return JSON.parse(content);
|
|
28
34
|
}
|
|
29
35
|
|
|
30
|
-
const
|
|
36
|
+
const fileUri = path.join('file://', filePath);
|
|
31
37
|
|
|
32
|
-
const config = await import(
|
|
38
|
+
const config = await import(fileUri);
|
|
33
39
|
|
|
34
40
|
if ('default' in config) {
|
|
35
41
|
return config.default;
|
|
@@ -37,7 +43,16 @@ async function loadConfig (fileName) {
|
|
|
37
43
|
|
|
38
44
|
return config;
|
|
39
45
|
}
|
|
40
|
-
catch {
|
|
41
|
-
|
|
46
|
+
catch (error) {
|
|
47
|
+
process.stderr.write(`Error reading ${filePath}\n`);
|
|
48
|
+
|
|
49
|
+
if (error instanceof Error) {
|
|
50
|
+
process.stderr.write(`${error.stack}\n`);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
process.stderr.write(`${error}\n`);
|
|
54
|
+
}
|
|
42
55
|
}
|
|
56
|
+
|
|
57
|
+
return;
|
|
43
58
|
}
|
package/helper/run-process.js
CHANGED
|
@@ -11,8 +11,8 @@ import * as os from 'node:os';
|
|
|
11
11
|
* Executes a process asynchronously.
|
|
12
12
|
*
|
|
13
13
|
* @public
|
|
14
|
-
* @param {string} command - The process to execute
|
|
15
|
-
* @param {childProcess.ExecOptions | undefined} [options] - The options of the `childProcess.exec()` method
|
|
14
|
+
* @param {string} command - The process to execute
|
|
15
|
+
* @param {childProcess.ExecOptions | undefined} [options] - The options of the `childProcess.exec()` method
|
|
16
16
|
* @returns {Promise<ProcessResult>} An object containing the result of the process execution
|
|
17
17
|
*/
|
|
18
18
|
export async function runProcess (command, options) {
|
|
@@ -33,7 +33,7 @@ export async function runProcess (command, options) {
|
|
|
33
33
|
...options?.env,
|
|
34
34
|
LINTER_BUNDLE: '1'
|
|
35
35
|
},
|
|
36
|
-
shell: os.userInfo().shell
|
|
36
|
+
shell: os.userInfo().shell ?? undefined
|
|
37
37
|
});
|
|
38
38
|
|
|
39
39
|
lintingProcess.stdout?.on('data', (/** @type {string} */data) => {
|