linter-bundle 5.1.0 → 6.1.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 +83 -9
- package/README.md +5 -3
- package/TODO.md +5 -0
- package/eslint/index.cjs +10 -4
- package/eslint/overrides-javascript.cjs +7 -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 +90 -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
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
|
|
11
11
|
import stylelint from 'stylelint';
|
|
12
12
|
// @ts-expect-error -- No declaration file.
|
|
13
|
-
import isStandardSyntaxRule from 'stylelint/lib/utils/isStandardSyntaxRule.
|
|
13
|
+
import isStandardSyntaxRule from 'stylelint/lib/utils/isStandardSyntaxRule.mjs';
|
|
14
14
|
// @ts-expect-error -- No declaration file.
|
|
15
|
-
import isStandardSyntaxSelector from 'stylelint/lib/utils/isStandardSyntaxSelector.
|
|
15
|
+
import isStandardSyntaxSelector from 'stylelint/lib/utils/isStandardSyntaxSelector.mjs';
|
|
16
16
|
// @ts-expect-error -- No declaration file.
|
|
17
|
-
import matchesStringOrRegExp from 'stylelint/lib/utils/matchesStringOrRegExp.
|
|
17
|
+
import matchesStringOrRegExp from 'stylelint/lib/utils/matchesStringOrRegExp.mjs';
|
|
18
18
|
// @ts-expect-error -- No declaration file.
|
|
19
|
-
import parseSelector from 'stylelint/lib/utils/parseSelector.
|
|
19
|
+
import parseSelector from 'stylelint/lib/utils/parseSelector.mjs';
|
|
20
20
|
|
|
21
21
|
const ruleName = 'plugin/selector-tag-no-without-class';
|
|
22
22
|
const messages = stylelint.utils.ruleMessages(ruleName, {
|
|
@@ -1,276 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Fork of `stylelint-high-performance-animation` rule.
|
|
3
|
-
*
|
|
4
|
-
* @license MIT
|
|
5
|
-
*
|
|
6
|
-
* @see https://github.com/kristerkari/stylelint-high-performance-animation
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import valueParser from 'postcss-value-parser';
|
|
10
|
-
/** @type {(declaration: import('postcss').Declaration) => number} */
|
|
11
|
-
import stylelint from 'stylelint';
|
|
12
|
-
// @ts-expect-error -- No declaration file.
|
|
13
|
-
import declarationValueIndex from 'stylelint/lib/utils/declarationValueIndex.js';
|
|
14
|
-
|
|
15
|
-
const ruleName = 'plugin/no-low-performance-animation-properties';
|
|
16
|
-
|
|
17
|
-
const messages = stylelint.utils.ruleMessages(ruleName, {
|
|
18
|
-
rejected: (type, property) => `Unexpected use of low performance ${type} property (${property}).`
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Function which ensures that a given `value` is of type "string".
|
|
23
|
-
*
|
|
24
|
-
* @param {any} value - Any value which should be ensured to be a string.
|
|
25
|
-
* @returns {boolean} - True if the value is a string, false otherwise.
|
|
26
|
-
*/
|
|
27
|
-
const isString = (value) => (typeof value === 'string');
|
|
28
|
-
|
|
29
|
-
// https://drafts.csswg.org/css-timing/
|
|
30
|
-
const cssLinearTimingFunctions = ['linear'];
|
|
31
|
-
const cssCubicBezierTimingFunctions = [
|
|
32
|
-
'ease',
|
|
33
|
-
'ease-in',
|
|
34
|
-
'ease-out',
|
|
35
|
-
'ease-in-out',
|
|
36
|
-
'cubic-bezier'
|
|
37
|
-
];
|
|
38
|
-
const cssStepTimingFunctions = ['step-start', 'step-end', 'steps'];
|
|
39
|
-
const cssFramesTimingFunctions = ['frames'];
|
|
40
|
-
const cssTimingFunctions = [
|
|
41
|
-
...cssLinearTimingFunctions,
|
|
42
|
-
...cssCubicBezierTimingFunctions,
|
|
43
|
-
...cssStepTimingFunctions,
|
|
44
|
-
...cssFramesTimingFunctions
|
|
45
|
-
];
|
|
46
|
-
const cssTimingFunctionsRE = new RegExp(`^(${cssTimingFunctions.join('|')}).*`, 'u');
|
|
47
|
-
|
|
48
|
-
const propertiesThatCauseLayout = [
|
|
49
|
-
'position',
|
|
50
|
-
'top',
|
|
51
|
-
'bottom',
|
|
52
|
-
'left',
|
|
53
|
-
'right',
|
|
54
|
-
'width',
|
|
55
|
-
'height',
|
|
56
|
-
'min-height',
|
|
57
|
-
'max-height',
|
|
58
|
-
'max-width',
|
|
59
|
-
'min-width',
|
|
60
|
-
'padding',
|
|
61
|
-
'padding-bottom',
|
|
62
|
-
'padding-left',
|
|
63
|
-
'padding-right',
|
|
64
|
-
'padding-top',
|
|
65
|
-
'margin',
|
|
66
|
-
'margin-bottom',
|
|
67
|
-
'margin-left',
|
|
68
|
-
'margin-right',
|
|
69
|
-
'margin-top',
|
|
70
|
-
'display',
|
|
71
|
-
'border-width',
|
|
72
|
-
'border-spacing',
|
|
73
|
-
'border-collapse',
|
|
74
|
-
'border',
|
|
75
|
-
'font',
|
|
76
|
-
'font-size',
|
|
77
|
-
'font-family',
|
|
78
|
-
'font-weight',
|
|
79
|
-
'font-style',
|
|
80
|
-
'float',
|
|
81
|
-
'overflow-y',
|
|
82
|
-
'overflow-x',
|
|
83
|
-
'overflow',
|
|
84
|
-
'line-height',
|
|
85
|
-
'vertical-align',
|
|
86
|
-
'clear',
|
|
87
|
-
'white-space',
|
|
88
|
-
'list-style',
|
|
89
|
-
'list-style-type',
|
|
90
|
-
'zoom',
|
|
91
|
-
'content',
|
|
92
|
-
'box-sizing',
|
|
93
|
-
'text-shadow',
|
|
94
|
-
'text-align',
|
|
95
|
-
'text-indent',
|
|
96
|
-
'text-transform',
|
|
97
|
-
'text-overflow',
|
|
98
|
-
'word-wrap',
|
|
99
|
-
'letter-spacing',
|
|
100
|
-
'appearance',
|
|
101
|
-
'direction'
|
|
102
|
-
];
|
|
103
|
-
|
|
104
|
-
const propsThatCausePaint = [
|
|
105
|
-
'color',
|
|
106
|
-
'border-color',
|
|
107
|
-
'border-style',
|
|
108
|
-
'border-radius',
|
|
109
|
-
'visibility',
|
|
110
|
-
'text-decoration',
|
|
111
|
-
'background',
|
|
112
|
-
'background-color',
|
|
113
|
-
'background-size',
|
|
114
|
-
'background-image',
|
|
115
|
-
'background-position',
|
|
116
|
-
'background-repeat',
|
|
117
|
-
'outline',
|
|
118
|
-
'outline-style',
|
|
119
|
-
'outline-width',
|
|
120
|
-
'outline-color',
|
|
121
|
-
'box-shadow'
|
|
122
|
-
];
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* Get disallowed properties.
|
|
126
|
-
*
|
|
127
|
-
* @param {string} ignore - Property name.
|
|
128
|
-
* @returns {string[]} - Array of disallowed properties.
|
|
129
|
-
*/
|
|
130
|
-
const getDisallowedList = (ignore) => {
|
|
131
|
-
if (ignore === 'paint-properties') {
|
|
132
|
-
return propertiesThatCauseLayout;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return propertiesThatCauseLayout.concat(propsThatCausePaint);
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/**
|
|
139
|
-
* Returns the input string stripped of its vendor prefix.
|
|
140
|
-
*
|
|
141
|
-
* @example
|
|
142
|
-
* unprefixed('-moz-tab-size') //=> 'tab-size'
|
|
143
|
-
*
|
|
144
|
-
* @param {string} property - String with or without vendor prefix.
|
|
145
|
-
* @returns {string} String name without vendor prefixes.
|
|
146
|
-
*/
|
|
147
|
-
const unprefixed = (property) => property.replace(/^-\w+-/u, '');
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Rule function.
|
|
151
|
-
*
|
|
152
|
-
* @param {Record<string, any>} actual - Primary options
|
|
153
|
-
* @param {Record<string, any>} options - Secondary options
|
|
154
|
-
* @returns {(root: import('postcss').Root, result: import('stylelint').PostcssResult) => Promise<void> | void} PostCSS plugin
|
|
155
|
-
*/
|
|
156
|
-
const ruleFunction = (actual, options) => (cssRoot, result) => {
|
|
157
|
-
const validOptions = stylelint.utils.validateOptions(
|
|
158
|
-
result,
|
|
159
|
-
ruleName,
|
|
160
|
-
{ actual },
|
|
161
|
-
{
|
|
162
|
-
actual: options,
|
|
163
|
-
possible: {
|
|
164
|
-
ignore: ['paint-properties'],
|
|
165
|
-
ignoreProperties: [isString]
|
|
166
|
-
},
|
|
167
|
-
optional: true
|
|
168
|
-
}
|
|
169
|
-
);
|
|
170
|
-
|
|
171
|
-
if (!validOptions) { return; }
|
|
172
|
-
|
|
173
|
-
const disallowedList = getDisallowedList(options['ignore']);
|
|
174
|
-
const ignored = options['ignoreProperties'] ?? [];
|
|
175
|
-
|
|
176
|
-
cssRoot.walkDecls('transition-property', (decl) => {
|
|
177
|
-
valueParser(decl.value).walk((node) => {
|
|
178
|
-
const value = unprefixed(node.value);
|
|
179
|
-
|
|
180
|
-
if (
|
|
181
|
-
node.type === 'word' &&
|
|
182
|
-
!ignored.includes(value) &&
|
|
183
|
-
(disallowedList.includes(value) || value === 'all')
|
|
184
|
-
) {
|
|
185
|
-
const index = declarationValueIndex(decl) + node.sourceIndex;
|
|
186
|
-
|
|
187
|
-
stylelint.utils.report({
|
|
188
|
-
ruleName,
|
|
189
|
-
result,
|
|
190
|
-
node: decl,
|
|
191
|
-
message: messages.rejected('transition', node.value),
|
|
192
|
-
index
|
|
193
|
-
});
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
|
|
198
|
-
cssRoot.walkDecls('transition', (decl) => {
|
|
199
|
-
/** @type {{ index: number; value: string; }[]} */
|
|
200
|
-
const nodes = [];
|
|
201
|
-
|
|
202
|
-
valueParser(decl.value).walk((node) => {
|
|
203
|
-
if (node.type === 'word' || node.type === 'function') {
|
|
204
|
-
nodes.push({
|
|
205
|
-
index: node.sourceIndex,
|
|
206
|
-
value: node.value
|
|
207
|
-
});
|
|
208
|
-
}
|
|
209
|
-
|
|
210
|
-
return false;
|
|
211
|
-
});
|
|
212
|
-
|
|
213
|
-
if (!ignored.includes('all')) {
|
|
214
|
-
const transitionProp = nodes.filter((node) => {
|
|
215
|
-
const isUnit = valueParser.unit(node.value);
|
|
216
|
-
const isTimingFunction = cssTimingFunctionsRE.test(node.value);
|
|
217
|
-
|
|
218
|
-
if (isUnit || isTimingFunction) {
|
|
219
|
-
return false;
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
return node;
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
if (nodes.length > 0 && transitionProp.length === 0) {
|
|
226
|
-
stylelint.utils.report({
|
|
227
|
-
ruleName,
|
|
228
|
-
result,
|
|
229
|
-
node: decl,
|
|
230
|
-
message: messages.rejected('transition', 'all'),
|
|
231
|
-
index: declarationValueIndex(decl) + nodes[0].index
|
|
232
|
-
});
|
|
233
|
-
|
|
234
|
-
return;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
|
|
238
|
-
for (const property of nodes) {
|
|
239
|
-
const index = declarationValueIndex(decl) + property.index;
|
|
240
|
-
const value = unprefixed(property.value);
|
|
241
|
-
|
|
242
|
-
if (
|
|
243
|
-
!ignored.includes(value) &&
|
|
244
|
-
(disallowedList.includes(value) || value === 'all')
|
|
245
|
-
) {
|
|
246
|
-
stylelint.utils.report({
|
|
247
|
-
ruleName,
|
|
248
|
-
result,
|
|
249
|
-
node: decl,
|
|
250
|
-
message: messages.rejected('transition', property.value),
|
|
251
|
-
index
|
|
252
|
-
});
|
|
253
|
-
}
|
|
254
|
-
}
|
|
255
|
-
});
|
|
256
|
-
|
|
257
|
-
cssRoot.walkAtRules(/^keyframes$/iu, (atRuleKeyframes) => {
|
|
258
|
-
atRuleKeyframes.walkDecls((decl) => {
|
|
259
|
-
const value = unprefixed(decl.prop);
|
|
260
|
-
|
|
261
|
-
if (!ignored.includes(value) && disallowedList.includes(value)) {
|
|
262
|
-
stylelint.utils.report({
|
|
263
|
-
ruleName,
|
|
264
|
-
result,
|
|
265
|
-
node: decl,
|
|
266
|
-
message: messages.rejected('animation', decl.prop)
|
|
267
|
-
});
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
|
|
273
|
-
ruleFunction.ruleName = ruleName;
|
|
274
|
-
ruleFunction.messages = messages;
|
|
275
|
-
|
|
276
|
-
export default stylelint.createPlugin(ruleName, ruleFunction);
|
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file Fork of the stylistic Stylelint rules.
|
|
3
|
-
*
|
|
4
|
-
* Stylistic rules have been deprecated in Stylelint v15 and will be removed in Stylelint v16, in favour of Prettier.
|
|
5
|
-
* To provide a smooth transition, we will fork them from the latest 15.x version which will contain them.
|
|
6
|
-
*
|
|
7
|
-
* The following stylistic rules are not considered, as they are not used by `linter-bundle`:
|
|
8
|
-
* - at-rule-name-newline-after
|
|
9
|
-
* - block-closing-brace-space-after
|
|
10
|
-
* - block-opening-brace-newline-before
|
|
11
|
-
*
|
|
12
|
-
* @license MIT
|
|
13
|
-
*
|
|
14
|
-
* @see https://stylelint.io/user-guide/rules/at-rule-name-case
|
|
15
|
-
* @see https://stylelint.io/user-guide/rules/at-rule-name-space-after
|
|
16
|
-
* @see https://stylelint.io/user-guide/rules/at-rule-semicolon-newline-after
|
|
17
|
-
* @see https://stylelint.io/user-guide/rules/at-rule-semicolon-space-before
|
|
18
|
-
* @see https://stylelint.io/user-guide/rules/block-closing-brace-empty-line-before
|
|
19
|
-
* @see https://stylelint.io/user-guide/rules/block-closing-brace-newline-after
|
|
20
|
-
* @see https://stylelint.io/user-guide/rules/block-closing-brace-newline-before
|
|
21
|
-
* @see https://stylelint.io/user-guide/rules/block-closing-brace-space-before
|
|
22
|
-
* @see https://stylelint.io/user-guide/rules/block-opening-brace-newline-after
|
|
23
|
-
* @see https://stylelint.io/user-guide/rules/block-opening-brace-space-after
|
|
24
|
-
* @see https://stylelint.io/user-guide/rules/block-opening-brace-space-before
|
|
25
|
-
* @see https://stylelint.io/user-guide/rules/color-hex-case
|
|
26
|
-
* @see https://stylelint.io/user-guide/rules/declaration-bang-space-after
|
|
27
|
-
* @see https://stylelint.io/user-guide/rules/declaration-bang-space-before
|
|
28
|
-
* @see https://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-after
|
|
29
|
-
* @see https://stylelint.io/user-guide/rules/declaration-block-semicolon-newline-before
|
|
30
|
-
* @see https://stylelint.io/user-guide/rules/declaration-block-semicolon-space-after
|
|
31
|
-
* @see https://stylelint.io/user-guide/rules/declaration-block-semicolon-space-before
|
|
32
|
-
* @see https://stylelint.io/user-guide/rules/declaration-block-trailing-semicolon
|
|
33
|
-
* @see https://stylelint.io/user-guide/rules/declaration-colon-newline-after
|
|
34
|
-
* @see https://stylelint.io/user-guide/rules/declaration-colon-space-after
|
|
35
|
-
* @see https://stylelint.io/user-guide/rules/declaration-colon-space-before
|
|
36
|
-
* @see https://stylelint.io/user-guide/rules/function-comma-newline-after
|
|
37
|
-
* @see https://stylelint.io/user-guide/rules/function-comma-newline-before
|
|
38
|
-
* @see https://stylelint.io/user-guide/rules/function-comma-space-after
|
|
39
|
-
* @see https://stylelint.io/user-guide/rules/function-comma-space-before
|
|
40
|
-
* @see https://stylelint.io/user-guide/rules/function-max-empty-lines
|
|
41
|
-
* @see https://stylelint.io/user-guide/rules/function-parentheses-newline-inside
|
|
42
|
-
* @see https://stylelint.io/user-guide/rules/function-parentheses-space-inside
|
|
43
|
-
* @see https://stylelint.io/user-guide/rules/function-whitespace-after
|
|
44
|
-
* @see https://stylelint.io/user-guide/rules/indentation
|
|
45
|
-
* @see https://stylelint.io/user-guide/rules/linebreaks
|
|
46
|
-
* @see https://stylelint.io/user-guide/rules/max-empty-lines
|
|
47
|
-
* @see https://stylelint.io/user-guide/rules/max-line-length
|
|
48
|
-
* @see https://stylelint.io/user-guide/rules/media-feature-colon-space-after
|
|
49
|
-
* @see https://stylelint.io/user-guide/rules/media-feature-colon-space-before
|
|
50
|
-
* @see https://stylelint.io/user-guide/rules/media-feature-name-case
|
|
51
|
-
* @see https://stylelint.io/user-guide/rules/media-feature-parentheses-space-inside
|
|
52
|
-
* @see https://stylelint.io/user-guide/rules/media-feature-range-operator-space-after
|
|
53
|
-
* @see https://stylelint.io/user-guide/rules/media-feature-range-operator-space-before
|
|
54
|
-
* @see https://stylelint.io/user-guide/rules/media-query-list-comma-newline-after
|
|
55
|
-
* @see https://stylelint.io/user-guide/rules/media-query-list-comma-newline-before
|
|
56
|
-
* @see https://stylelint.io/user-guide/rules/media-query-list-comma-space-after
|
|
57
|
-
* @see https://stylelint.io/user-guide/rules/media-query-list-comma-space-before
|
|
58
|
-
* @see https://stylelint.io/user-guide/rules/no-empty-first-line
|
|
59
|
-
* @see https://stylelint.io/user-guide/rules/no-eol-whitespace
|
|
60
|
-
* @see https://stylelint.io/user-guide/rules/no-extra-semicolons
|
|
61
|
-
* @see https://stylelint.io/user-guide/rules/no-missing-end-of-source-newline
|
|
62
|
-
* @see https://stylelint.io/user-guide/rules/number-leading-zero
|
|
63
|
-
* @see https://stylelint.io/user-guide/rules/number-no-trailing-zeros
|
|
64
|
-
* @see https://stylelint.io/user-guide/rules/property-case
|
|
65
|
-
* @see https://stylelint.io/user-guide/rules/selector-attribute-brackets-space-inside
|
|
66
|
-
* @see https://stylelint.io/user-guide/rules/selector-attribute-operator-space-after
|
|
67
|
-
* @see https://stylelint.io/user-guide/rules/selector-attribute-operator-space-before
|
|
68
|
-
* @see https://stylelint.io/user-guide/rules/selector-combinator-space-after
|
|
69
|
-
* @see https://stylelint.io/user-guide/rules/selector-combinator-space-before
|
|
70
|
-
* @see https://stylelint.io/user-guide/rules/selector-descendant-combinator-no-non-space
|
|
71
|
-
* @see https://stylelint.io/user-guide/rules/selector-list-comma-newline-after
|
|
72
|
-
* @see https://stylelint.io/user-guide/rules/selector-list-comma-newline-before
|
|
73
|
-
* @see https://stylelint.io/user-guide/rules/selector-list-comma-space-after
|
|
74
|
-
* @see https://stylelint.io/user-guide/rules/selector-list-comma-space-before
|
|
75
|
-
* @see https://stylelint.io/user-guide/rules/selector-max-empty-lines
|
|
76
|
-
* @see https://stylelint.io/user-guide/rules/selector-pseudo-class-case
|
|
77
|
-
* @see https://stylelint.io/user-guide/rules/selector-pseudo-class-parentheses-space-inside
|
|
78
|
-
* @see https://stylelint.io/user-guide/rules/selector-pseudo-element-case
|
|
79
|
-
* @see https://stylelint.io/user-guide/rules/string-quotes
|
|
80
|
-
* @see https://stylelint.io/user-guide/rules/unicode-bom
|
|
81
|
-
* @see https://stylelint.io/user-guide/rules/unit-case
|
|
82
|
-
* @see https://stylelint.io/user-guide/rules/value-list-comma-newline-after
|
|
83
|
-
* @see https://stylelint.io/user-guide/rules/value-list-comma-newline-before
|
|
84
|
-
* @see https://stylelint.io/user-guide/rules/value-list-comma-space-after
|
|
85
|
-
* @see https://stylelint.io/user-guide/rules/value-list-comma-space-before
|
|
86
|
-
* @see https://stylelint.io/user-guide/rules/value-list-max-empty-lines
|
|
87
|
-
*/
|
|
88
|
-
|
|
89
|
-
import stylelint from 'stylelint';
|
|
90
|
-
// @ts-expect-error -- There's no type definition for this file.
|
|
91
|
-
import rules from 'stylelint/lib/rules/index.js';
|
|
92
|
-
|
|
93
|
-
export default await Promise.all([
|
|
94
|
-
'at-rule-name-case',
|
|
95
|
-
'at-rule-name-space-after',
|
|
96
|
-
'at-rule-semicolon-newline-after',
|
|
97
|
-
'at-rule-semicolon-space-before',
|
|
98
|
-
'block-closing-brace-empty-line-before',
|
|
99
|
-
'block-closing-brace-newline-after',
|
|
100
|
-
'block-closing-brace-newline-before',
|
|
101
|
-
'block-closing-brace-space-before',
|
|
102
|
-
'block-opening-brace-newline-after',
|
|
103
|
-
'block-opening-brace-space-after',
|
|
104
|
-
'block-opening-brace-space-before',
|
|
105
|
-
'color-hex-case',
|
|
106
|
-
'declaration-bang-space-after',
|
|
107
|
-
'declaration-bang-space-before',
|
|
108
|
-
'declaration-block-semicolon-newline-after',
|
|
109
|
-
'declaration-block-semicolon-newline-before',
|
|
110
|
-
'declaration-block-semicolon-space-after',
|
|
111
|
-
'declaration-block-semicolon-space-before',
|
|
112
|
-
'declaration-block-trailing-semicolon',
|
|
113
|
-
'declaration-colon-newline-after',
|
|
114
|
-
'declaration-colon-space-after',
|
|
115
|
-
'declaration-colon-space-before',
|
|
116
|
-
'function-comma-newline-after',
|
|
117
|
-
'function-comma-newline-before',
|
|
118
|
-
'function-comma-space-after',
|
|
119
|
-
'function-comma-space-before',
|
|
120
|
-
'function-max-empty-lines',
|
|
121
|
-
'function-parentheses-newline-inside',
|
|
122
|
-
'function-parentheses-space-inside',
|
|
123
|
-
'function-whitespace-after',
|
|
124
|
-
'indentation',
|
|
125
|
-
'linebreaks',
|
|
126
|
-
'max-empty-lines',
|
|
127
|
-
'max-line-length',
|
|
128
|
-
'media-feature-colon-space-after',
|
|
129
|
-
'media-feature-colon-space-before',
|
|
130
|
-
'media-feature-name-case',
|
|
131
|
-
'media-feature-parentheses-space-inside',
|
|
132
|
-
'media-feature-range-operator-space-after',
|
|
133
|
-
'media-feature-range-operator-space-before',
|
|
134
|
-
'media-query-list-comma-newline-after',
|
|
135
|
-
'media-query-list-comma-newline-before',
|
|
136
|
-
'media-query-list-comma-space-after',
|
|
137
|
-
'media-query-list-comma-space-before',
|
|
138
|
-
'no-empty-first-line',
|
|
139
|
-
'no-eol-whitespace',
|
|
140
|
-
'no-extra-semicolons',
|
|
141
|
-
'no-missing-end-of-source-newline',
|
|
142
|
-
'number-leading-zero',
|
|
143
|
-
'number-no-trailing-zeros',
|
|
144
|
-
'property-case',
|
|
145
|
-
'selector-attribute-brackets-space-inside',
|
|
146
|
-
'selector-attribute-operator-space-after',
|
|
147
|
-
'selector-attribute-operator-space-before',
|
|
148
|
-
'selector-combinator-space-after',
|
|
149
|
-
'selector-combinator-space-before',
|
|
150
|
-
'selector-descendant-combinator-no-non-space',
|
|
151
|
-
'selector-list-comma-newline-after',
|
|
152
|
-
'selector-list-comma-newline-before',
|
|
153
|
-
'selector-list-comma-space-after',
|
|
154
|
-
'selector-list-comma-space-before',
|
|
155
|
-
'selector-max-empty-lines',
|
|
156
|
-
'selector-pseudo-class-case',
|
|
157
|
-
'selector-pseudo-class-parentheses-space-inside',
|
|
158
|
-
'selector-pseudo-element-case',
|
|
159
|
-
'string-quotes',
|
|
160
|
-
'unicode-bom',
|
|
161
|
-
'unit-case',
|
|
162
|
-
'value-list-comma-newline-after',
|
|
163
|
-
'value-list-comma-newline-before',
|
|
164
|
-
'value-list-comma-space-after',
|
|
165
|
-
'value-list-comma-space-before',
|
|
166
|
-
'value-list-max-empty-lines'
|
|
167
|
-
].map(async (ruleName) => {
|
|
168
|
-
const rule = rules[ruleName];
|
|
169
|
-
|
|
170
|
-
const forkedRule = Object.assign(
|
|
171
|
-
/**
|
|
172
|
-
* Wrapper for the original rule, to be able to manipulate the additional properties.
|
|
173
|
-
*
|
|
174
|
-
* @param {Parameters<import('stylelint').RuleBase>} args - The arguments of the rule function
|
|
175
|
-
* @returns {ReturnType<import('stylelint').RuleBase>} The return value of the rule function
|
|
176
|
-
*/
|
|
177
|
-
(...args) => rule(...args),
|
|
178
|
-
rule
|
|
179
|
-
);
|
|
180
|
-
|
|
181
|
-
forkedRule.ruleName = `plugin/${ruleName}`;
|
|
182
|
-
forkedRule.meta = {
|
|
183
|
-
...rule.meta,
|
|
184
|
-
deprecated: false
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
return stylelint.createPlugin(`plugin/${ruleName}`, forkedRule);
|
|
188
|
-
}));
|