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
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
|
|
4
|
+
const uniteSets = require('stylelint/lib/utils/uniteSets.cjs');
|
|
5
|
+
|
|
6
|
+
const htmlTags = require('../html-tags/index.cjs');
|
|
7
|
+
|
|
8
|
+
const deprecatedHtmlTypeSelectors = new Set([
|
|
9
|
+
'acronym',
|
|
10
|
+
'applet',
|
|
11
|
+
'basefont',
|
|
12
|
+
'big',
|
|
13
|
+
'blink',
|
|
14
|
+
'center',
|
|
15
|
+
'content',
|
|
16
|
+
'dir',
|
|
17
|
+
'font',
|
|
18
|
+
'frame',
|
|
19
|
+
'frameset',
|
|
20
|
+
'hgroup',
|
|
21
|
+
'isindex',
|
|
22
|
+
'keygen',
|
|
23
|
+
'listing',
|
|
24
|
+
'marquee',
|
|
25
|
+
'nobr',
|
|
26
|
+
'noembed',
|
|
27
|
+
'plaintext',
|
|
28
|
+
'spacer',
|
|
29
|
+
'strike',
|
|
30
|
+
'tt',
|
|
31
|
+
'xmp'
|
|
32
|
+
]);
|
|
33
|
+
|
|
34
|
+
// typecasting htmlTags to be more generic; see https://github.com/stylelint/stylelint/pull/6013 for discussion
|
|
35
|
+
/** @type {Set<string>} */
|
|
36
|
+
const standardHtmlTypeSelectors = new Set(htmlTags);
|
|
37
|
+
|
|
38
|
+
const htmlTypeSelectors = uniteSets(deprecatedHtmlTypeSelectors, standardHtmlTypeSelectors);
|
|
39
|
+
|
|
40
|
+
const mixedCaseSvgTypeSelectors = new Set([
|
|
41
|
+
'altGlyph',
|
|
42
|
+
'altGlyphDef',
|
|
43
|
+
'altGlyphItem',
|
|
44
|
+
'animateColor',
|
|
45
|
+
'animateMotion',
|
|
46
|
+
'animateTransform',
|
|
47
|
+
'clipPath',
|
|
48
|
+
'feBlend',
|
|
49
|
+
'feColorMatrix',
|
|
50
|
+
'feComponentTransfer',
|
|
51
|
+
'feComposite',
|
|
52
|
+
'feConvolveMatrix',
|
|
53
|
+
'feDiffuseLighting',
|
|
54
|
+
'feDisplacementMap',
|
|
55
|
+
'feDistantLight',
|
|
56
|
+
'feDropShadow',
|
|
57
|
+
'feFlood',
|
|
58
|
+
'feFuncA',
|
|
59
|
+
'feFuncB',
|
|
60
|
+
'feFuncG',
|
|
61
|
+
'feFuncR',
|
|
62
|
+
'feGaussianBlur',
|
|
63
|
+
'feImage',
|
|
64
|
+
'feMerge',
|
|
65
|
+
'feMergeNode',
|
|
66
|
+
'feMorphology',
|
|
67
|
+
'feOffset',
|
|
68
|
+
'fePointLight',
|
|
69
|
+
'feSpecularLighting',
|
|
70
|
+
'feSpotLight',
|
|
71
|
+
'feTile',
|
|
72
|
+
'feTurbulence',
|
|
73
|
+
'foreignObject',
|
|
74
|
+
'glyphRef',
|
|
75
|
+
'linearGradient',
|
|
76
|
+
'radialGradient',
|
|
77
|
+
'textPath'
|
|
78
|
+
]);
|
|
79
|
+
|
|
80
|
+
// These are the ones that can have single-colon notation
|
|
81
|
+
const levelOneAndTwoPseudoElements = new Set(['before', 'after', 'first-line', 'first-letter']);
|
|
82
|
+
|
|
83
|
+
const shadowTreePseudoElements = new Set(['part']);
|
|
84
|
+
|
|
85
|
+
const webkitScrollbarPseudoElements = new Set([
|
|
86
|
+
'-webkit-resizer',
|
|
87
|
+
'-webkit-scrollbar',
|
|
88
|
+
'-webkit-scrollbar-button',
|
|
89
|
+
'-webkit-scrollbar-corner',
|
|
90
|
+
'-webkit-scrollbar-thumb',
|
|
91
|
+
'-webkit-scrollbar-track',
|
|
92
|
+
'-webkit-scrollbar-track-piece'
|
|
93
|
+
]);
|
|
94
|
+
|
|
95
|
+
const vendorSpecificPseudoElements = uniteSets(webkitScrollbarPseudoElements, [
|
|
96
|
+
'-moz-focus-inner',
|
|
97
|
+
'-moz-focus-outer',
|
|
98
|
+
'-moz-list-bullet',
|
|
99
|
+
'-moz-meter-bar',
|
|
100
|
+
'-moz-placeholder',
|
|
101
|
+
'-moz-progress-bar',
|
|
102
|
+
'-moz-range-progress',
|
|
103
|
+
'-moz-range-thumb',
|
|
104
|
+
'-moz-range-track',
|
|
105
|
+
'-ms-browse',
|
|
106
|
+
'-ms-check',
|
|
107
|
+
'-ms-clear',
|
|
108
|
+
'-ms-expand',
|
|
109
|
+
'-ms-fill',
|
|
110
|
+
'-ms-fill-lower',
|
|
111
|
+
'-ms-fill-upper',
|
|
112
|
+
'-ms-reveal',
|
|
113
|
+
'-ms-thumb',
|
|
114
|
+
'-ms-ticks-after',
|
|
115
|
+
'-ms-ticks-before',
|
|
116
|
+
'-ms-tooltip',
|
|
117
|
+
'-ms-track',
|
|
118
|
+
'-ms-value',
|
|
119
|
+
'-webkit-color-swatch',
|
|
120
|
+
'-webkit-color-swatch-wrapper',
|
|
121
|
+
'-webkit-calendar-picker-indicator',
|
|
122
|
+
'-webkit-clear-button',
|
|
123
|
+
'-webkit-date-and-time-value',
|
|
124
|
+
'-webkit-datetime-edit',
|
|
125
|
+
'-webkit-datetime-edit-ampm-field',
|
|
126
|
+
'-webkit-datetime-edit-day-field',
|
|
127
|
+
'-webkit-datetime-edit-fields-wrapper',
|
|
128
|
+
'-webkit-datetime-edit-hour-field',
|
|
129
|
+
'-webkit-datetime-edit-millisecond-field',
|
|
130
|
+
'-webkit-datetime-edit-minute-field',
|
|
131
|
+
'-webkit-datetime-edit-month-field',
|
|
132
|
+
'-webkit-datetime-edit-second-field',
|
|
133
|
+
'-webkit-datetime-edit-text',
|
|
134
|
+
'-webkit-datetime-edit-week-field',
|
|
135
|
+
'-webkit-datetime-edit-year-field',
|
|
136
|
+
'-webkit-details-marker',
|
|
137
|
+
'-webkit-distributed',
|
|
138
|
+
'-webkit-file-upload-button',
|
|
139
|
+
'-webkit-input-placeholder',
|
|
140
|
+
'-webkit-keygen-select',
|
|
141
|
+
'-webkit-meter-bar',
|
|
142
|
+
'-webkit-meter-even-less-good-value',
|
|
143
|
+
'-webkit-meter-inner-element',
|
|
144
|
+
'-webkit-meter-optimum-value',
|
|
145
|
+
'-webkit-meter-suboptimum-value',
|
|
146
|
+
'-webkit-progress-bar',
|
|
147
|
+
'-webkit-progress-inner-element',
|
|
148
|
+
'-webkit-progress-value',
|
|
149
|
+
'-webkit-search-cancel-button',
|
|
150
|
+
'-webkit-search-decoration',
|
|
151
|
+
'-webkit-search-results-button',
|
|
152
|
+
'-webkit-search-results-decoration',
|
|
153
|
+
'-webkit-slider-runnable-track',
|
|
154
|
+
'-webkit-slider-thumb',
|
|
155
|
+
'-webkit-textfield-decoration-container',
|
|
156
|
+
'-webkit-validation-bubble',
|
|
157
|
+
'-webkit-validation-bubble-arrow',
|
|
158
|
+
'-webkit-validation-bubble-arrow-clipper',
|
|
159
|
+
'-webkit-validation-bubble-heading',
|
|
160
|
+
'-webkit-validation-bubble-message',
|
|
161
|
+
'-webkit-validation-bubble-text-block'
|
|
162
|
+
]);
|
|
163
|
+
|
|
164
|
+
const pseudoElements = uniteSets(
|
|
165
|
+
levelOneAndTwoPseudoElements,
|
|
166
|
+
vendorSpecificPseudoElements,
|
|
167
|
+
shadowTreePseudoElements,
|
|
168
|
+
[
|
|
169
|
+
'backdrop',
|
|
170
|
+
'content',
|
|
171
|
+
'cue',
|
|
172
|
+
'file-selector-button',
|
|
173
|
+
'grammar-error',
|
|
174
|
+
'highlight',
|
|
175
|
+
'marker',
|
|
176
|
+
'placeholder',
|
|
177
|
+
'selection',
|
|
178
|
+
'shadow',
|
|
179
|
+
'slotted',
|
|
180
|
+
'spelling-error',
|
|
181
|
+
'target-text',
|
|
182
|
+
'view-transition',
|
|
183
|
+
'view-transition-group',
|
|
184
|
+
'view-transition-image-pair',
|
|
185
|
+
'view-transition-new',
|
|
186
|
+
'view-transition-old'
|
|
187
|
+
]
|
|
188
|
+
);
|
|
189
|
+
|
|
190
|
+
const aNPlusBNotationPseudoClasses = new Set([
|
|
191
|
+
'nth-column',
|
|
192
|
+
'nth-last-column',
|
|
193
|
+
'nth-last-of-type',
|
|
194
|
+
'nth-of-type'
|
|
195
|
+
]);
|
|
196
|
+
|
|
197
|
+
const aNPlusBOfSNotationPseudoClasses = new Set(['nth-child', 'nth-last-child']);
|
|
198
|
+
|
|
199
|
+
const atRulePagePseudoClasses = new Set(['first', 'right', 'left', 'blank']);
|
|
200
|
+
|
|
201
|
+
const linguisticPseudoClasses = new Set(['dir', 'lang']);
|
|
202
|
+
|
|
203
|
+
const logicalCombinationsPseudoClasses = new Set(['has', 'is', 'matches', 'not', 'where']);
|
|
204
|
+
|
|
205
|
+
const vendorSpecificPseudoClasses = new Set([
|
|
206
|
+
'-khtml-drag',
|
|
207
|
+
'-moz-any',
|
|
208
|
+
'-moz-any-link',
|
|
209
|
+
'-moz-broken',
|
|
210
|
+
'-moz-drag-over',
|
|
211
|
+
'-moz-first-node',
|
|
212
|
+
'-moz-focusring',
|
|
213
|
+
'-moz-full-screen',
|
|
214
|
+
'-moz-full-screen-ancestor',
|
|
215
|
+
'-moz-last-node',
|
|
216
|
+
'-moz-loading',
|
|
217
|
+
'-moz-meter-optimum',
|
|
218
|
+
'-moz-meter-sub-optimum',
|
|
219
|
+
'-moz-meter-sub-sub-optimum',
|
|
220
|
+
'-moz-placeholder',
|
|
221
|
+
'-moz-submit-invalid',
|
|
222
|
+
'-moz-suppressed',
|
|
223
|
+
'-moz-ui-invalid',
|
|
224
|
+
'-moz-ui-valid',
|
|
225
|
+
'-moz-user-disabled',
|
|
226
|
+
'-moz-window-inactive',
|
|
227
|
+
'-ms-fullscreen',
|
|
228
|
+
'-ms-input-placeholder',
|
|
229
|
+
'-webkit-drag',
|
|
230
|
+
'-webkit-any',
|
|
231
|
+
'-webkit-any-link',
|
|
232
|
+
'-webkit-autofill',
|
|
233
|
+
'-webkit-full-screen',
|
|
234
|
+
'-webkit-full-screen-ancestor'
|
|
235
|
+
]);
|
|
236
|
+
|
|
237
|
+
// https://webkit.org/blog/363/styling-scrollbars/
|
|
238
|
+
const webkitScrollbarPseudoClasses = new Set([
|
|
239
|
+
'horizontal',
|
|
240
|
+
'vertical',
|
|
241
|
+
'decrement',
|
|
242
|
+
'increment',
|
|
243
|
+
'start',
|
|
244
|
+
'end',
|
|
245
|
+
'double-button',
|
|
246
|
+
'single-button',
|
|
247
|
+
'no-button',
|
|
248
|
+
'corner-present',
|
|
249
|
+
'window-inactive'
|
|
250
|
+
]);
|
|
251
|
+
|
|
252
|
+
const pseudoClasses = uniteSets(
|
|
253
|
+
aNPlusBNotationPseudoClasses,
|
|
254
|
+
linguisticPseudoClasses,
|
|
255
|
+
logicalCombinationsPseudoClasses,
|
|
256
|
+
aNPlusBOfSNotationPseudoClasses,
|
|
257
|
+
vendorSpecificPseudoClasses,
|
|
258
|
+
[
|
|
259
|
+
'active',
|
|
260
|
+
'any-link',
|
|
261
|
+
'autofill',
|
|
262
|
+
'blank',
|
|
263
|
+
'checked',
|
|
264
|
+
'current',
|
|
265
|
+
'default',
|
|
266
|
+
'defined',
|
|
267
|
+
'disabled',
|
|
268
|
+
'empty',
|
|
269
|
+
'enabled',
|
|
270
|
+
'first-child',
|
|
271
|
+
'first-of-type',
|
|
272
|
+
'focus',
|
|
273
|
+
'focus-within',
|
|
274
|
+
'focus-visible',
|
|
275
|
+
'fullscreen',
|
|
276
|
+
'fullscreen-ancestor',
|
|
277
|
+
'future',
|
|
278
|
+
'host',
|
|
279
|
+
'host-context',
|
|
280
|
+
'hover',
|
|
281
|
+
'indeterminate',
|
|
282
|
+
'in-range',
|
|
283
|
+
'invalid',
|
|
284
|
+
'last-child',
|
|
285
|
+
'last-of-type',
|
|
286
|
+
'link',
|
|
287
|
+
'modal',
|
|
288
|
+
'only-child',
|
|
289
|
+
'only-of-type',
|
|
290
|
+
'optional',
|
|
291
|
+
'out-of-range',
|
|
292
|
+
'past',
|
|
293
|
+
'placeholder-shown',
|
|
294
|
+
'playing',
|
|
295
|
+
'picture-in-picture',
|
|
296
|
+
'paused',
|
|
297
|
+
'read-only',
|
|
298
|
+
'read-write',
|
|
299
|
+
'required',
|
|
300
|
+
'root',
|
|
301
|
+
'scope',
|
|
302
|
+
'state',
|
|
303
|
+
'target',
|
|
304
|
+
'unresolved',
|
|
305
|
+
'user-invalid',
|
|
306
|
+
'user-valid',
|
|
307
|
+
'valid',
|
|
308
|
+
'visited',
|
|
309
|
+
'window-inactive' // for ::selection (chrome)
|
|
310
|
+
]
|
|
311
|
+
);
|
|
312
|
+
|
|
313
|
+
module.exports = {
|
|
314
|
+
aNPlusBNotationPseudoClasses,
|
|
315
|
+
aNPlusBOfSNotationPseudoClasses,
|
|
316
|
+
atRulePagePseudoClasses,
|
|
317
|
+
levelOneAndTwoPseudoElements,
|
|
318
|
+
linguisticPseudoClasses,
|
|
319
|
+
logicalCombinationsPseudoClasses,
|
|
320
|
+
mixedCaseSvgTypeSelectors,
|
|
321
|
+
pseudoClasses,
|
|
322
|
+
pseudoElements,
|
|
323
|
+
shadowTreePseudoElements,
|
|
324
|
+
htmlTypeSelectors,
|
|
325
|
+
webkitScrollbarPseudoClasses,
|
|
326
|
+
webkitScrollbarPseudoElements
|
|
327
|
+
};
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
# at-rule-name-case
|
|
2
|
+
|
|
3
|
+
Specify lowercase or uppercase for at-rules names.
|
|
4
|
+
|
|
5
|
+
<!-- prettier-ignore -->
|
|
6
|
+
```css
|
|
7
|
+
@media (min-width: 10px) {}
|
|
8
|
+
/** ↑
|
|
9
|
+
* This at-rule name */
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
Only lowercase at-rule names are valid in SCSS.
|
|
13
|
+
|
|
14
|
+
The [`fix` option](https://stylelint.io/user-guide/options/#fix) can automatically fix some of the problems reported by this rule.
|
|
15
|
+
|
|
16
|
+
## Options
|
|
17
|
+
|
|
18
|
+
`string`: `"lower"|"upper"`
|
|
19
|
+
|
|
20
|
+
### `"lower"`
|
|
21
|
+
|
|
22
|
+
The following patterns are considered problems:
|
|
23
|
+
|
|
24
|
+
<!-- prettier-ignore -->
|
|
25
|
+
```css
|
|
26
|
+
@Charset 'UTF-8';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
<!-- prettier-ignore -->
|
|
30
|
+
```css
|
|
31
|
+
@cHarSeT 'UTF-8';
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
<!-- prettier-ignore -->
|
|
35
|
+
```css
|
|
36
|
+
@CHARSET 'UTF-8';
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
<!-- prettier-ignore -->
|
|
40
|
+
```css
|
|
41
|
+
@Media (min-width: 50em) {}
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
<!-- prettier-ignore -->
|
|
45
|
+
```css
|
|
46
|
+
@mEdIa (min-width: 50em) {}
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
<!-- prettier-ignore -->
|
|
50
|
+
```css
|
|
51
|
+
@MEDIA (min-width: 50em) {}
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The following patterns are _not_ considered problems:
|
|
55
|
+
|
|
56
|
+
<!-- prettier-ignore -->
|
|
57
|
+
```css
|
|
58
|
+
@charset 'UTF-8';
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
<!-- prettier-ignore -->
|
|
62
|
+
```css
|
|
63
|
+
@media (min-width: 50em) {}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### `"upper"`
|
|
67
|
+
|
|
68
|
+
The following patterns are considered problems:
|
|
69
|
+
|
|
70
|
+
<!-- prettier-ignore -->
|
|
71
|
+
```css
|
|
72
|
+
@Charset 'UTF-8';
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
<!-- prettier-ignore -->
|
|
76
|
+
```css
|
|
77
|
+
@cHarSeT 'UTF-8';
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
<!-- prettier-ignore -->
|
|
81
|
+
```css
|
|
82
|
+
@charset 'UTF-8';
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
<!-- prettier-ignore -->
|
|
86
|
+
```css
|
|
87
|
+
@Media (min-width: 50em) {}
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
<!-- prettier-ignore -->
|
|
91
|
+
```css
|
|
92
|
+
@mEdIa (min-width: 50em) {}
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
<!-- prettier-ignore -->
|
|
96
|
+
```css
|
|
97
|
+
@media (min-width: 50em) {}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
The following patterns are _not_ considered problems:
|
|
101
|
+
|
|
102
|
+
<!-- prettier-ignore -->
|
|
103
|
+
```css
|
|
104
|
+
@CHARSET 'UTF-8';
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
<!-- prettier-ignore -->
|
|
108
|
+
```css
|
|
109
|
+
@MEDIA (min-width: 50em) {}
|
|
110
|
+
```
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
|
|
4
|
+
const stylelint = require('stylelint');
|
|
5
|
+
const isStandardSyntaxAtRule = require('stylelint/lib/utils/isStandardSyntaxAtRule.cjs');
|
|
6
|
+
const report = require('stylelint/lib/utils/report.cjs');
|
|
7
|
+
const ruleMessages = require('stylelint/lib/utils/ruleMessages.cjs');
|
|
8
|
+
const validateOptions = require('stylelint/lib/utils/validateOptions.cjs');
|
|
9
|
+
|
|
10
|
+
const ruleName = 'plugin/at-rule-name-case';
|
|
11
|
+
|
|
12
|
+
const messages = ruleMessages(ruleName, {
|
|
13
|
+
expected: (actual, expected) => `Expected "${actual}" to be "${expected}"`
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
const meta = {
|
|
17
|
+
url: 'https://github.com/jens-duttke/linter-bundle/blob/main/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/README.md',
|
|
18
|
+
fixable: true
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
/** @type {import('stylelint').Rule} */
|
|
22
|
+
const rule = (primary, _secondary, context) => (root, result) => {
|
|
23
|
+
const validOptions = validateOptions(result, ruleName, {
|
|
24
|
+
actual: primary,
|
|
25
|
+
possible: ['lower', 'upper']
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
if (!validOptions) {
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** @type {'lower' | 'upper'} */
|
|
33
|
+
const expectation = primary;
|
|
34
|
+
|
|
35
|
+
root.walkAtRules((atRule) => {
|
|
36
|
+
if (!isStandardSyntaxAtRule(atRule)) {
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const name = atRule.name;
|
|
41
|
+
|
|
42
|
+
const expectedName = expectation === 'lower' ? name.toLowerCase() : name.toUpperCase();
|
|
43
|
+
|
|
44
|
+
if (name === expectedName) {
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if (context.fix) {
|
|
49
|
+
atRule.name = expectedName;
|
|
50
|
+
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
report({
|
|
55
|
+
message: messages.expected(name, expectedName),
|
|
56
|
+
node: atRule,
|
|
57
|
+
ruleName,
|
|
58
|
+
result
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
rule.ruleName = ruleName;
|
|
64
|
+
rule.messages = messages;
|
|
65
|
+
rule.meta = meta;
|
|
66
|
+
module.exports = stylelint.createPlugin(ruleName, rule);
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/README.md
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# at-rule-name-space-after
|
|
2
|
+
|
|
3
|
+
Require a single space after at-rule names.
|
|
4
|
+
|
|
5
|
+
<!-- prettier-ignore -->
|
|
6
|
+
```css
|
|
7
|
+
@media (max-width: 600px) {}
|
|
8
|
+
/** ↑
|
|
9
|
+
* The space after at-rule names */
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
The [`fix` option](https://stylelint.io/user-guide/options/#fix) can automatically fix all of the problems reported by this rule.
|
|
13
|
+
|
|
14
|
+
## Options
|
|
15
|
+
|
|
16
|
+
`string`: `"always"|"always-single-line"`
|
|
17
|
+
|
|
18
|
+
### `"always"`
|
|
19
|
+
|
|
20
|
+
There _must always_ be a single space after at-rule names.
|
|
21
|
+
|
|
22
|
+
The following patterns are considered problems:
|
|
23
|
+
|
|
24
|
+
<!-- prettier-ignore -->
|
|
25
|
+
```css
|
|
26
|
+
@charset"UTF-8";
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
<!-- prettier-ignore -->
|
|
30
|
+
```css
|
|
31
|
+
@media(min-width: 700px) {}
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
<!-- prettier-ignore -->
|
|
35
|
+
```css
|
|
36
|
+
@media (min-width: 700px) {}
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
<!-- prettier-ignore -->
|
|
40
|
+
```css
|
|
41
|
+
@media
|
|
42
|
+
(min-width: 700px) {}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The following patterns are _not_ considered problems:
|
|
46
|
+
|
|
47
|
+
<!-- prettier-ignore -->
|
|
48
|
+
```css
|
|
49
|
+
@charset "UTF-8";
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
<!-- prettier-ignore -->
|
|
53
|
+
```css
|
|
54
|
+
@import url("x.css");
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
<!-- prettier-ignore -->
|
|
58
|
+
```css
|
|
59
|
+
@media (min-width: 700px) {}
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
### `"always-single-line"`
|
|
63
|
+
|
|
64
|
+
There _must always_ be a single space after at-rule names in single-line declaration blocks.
|
|
65
|
+
|
|
66
|
+
The following patterns are considered problems:
|
|
67
|
+
|
|
68
|
+
<!-- prettier-ignore -->
|
|
69
|
+
```css
|
|
70
|
+
@charset"UTF-8";
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
<!-- prettier-ignore -->
|
|
74
|
+
```css
|
|
75
|
+
@media(min-width: 700px) {}
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
<!-- prettier-ignore -->
|
|
79
|
+
```css
|
|
80
|
+
@media (min-width: 700px) {}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The following patterns are _not_ considered problems:
|
|
84
|
+
|
|
85
|
+
<!-- prettier-ignore -->
|
|
86
|
+
```css
|
|
87
|
+
@charset "UTF-8";
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
<!-- prettier-ignore -->
|
|
91
|
+
```css
|
|
92
|
+
@import url("x.css");
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
<!-- prettier-ignore -->
|
|
96
|
+
```css
|
|
97
|
+
@media (min-width: 700px) {}
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
<!-- prettier-ignore -->
|
|
101
|
+
```css
|
|
102
|
+
@media
|
|
103
|
+
(min-width: 700px) {}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
<!-- prettier-ignore -->
|
|
107
|
+
```css
|
|
108
|
+
@media(min-width: 700px) and
|
|
109
|
+
(orientation: portrait) {}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
<!-- prettier-ignore -->
|
|
113
|
+
```css
|
|
114
|
+
@media
|
|
115
|
+
(min-width: 700px) and
|
|
116
|
+
(orientation: portrait) {}
|
|
117
|
+
```
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/index.cjs
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
|
|
4
|
+
const stylelint = require('stylelint');
|
|
5
|
+
const ruleMessages = require('stylelint/lib/utils/ruleMessages.cjs');
|
|
6
|
+
const validateOptions = require('stylelint/lib/utils/validateOptions.cjs');
|
|
7
|
+
|
|
8
|
+
const whitespaceChecker = require('../../utils/whitespaceChecker.cjs');
|
|
9
|
+
const atRuleNameSpaceChecker = require('../atRuleNameSpaceChecker.cjs');
|
|
10
|
+
|
|
11
|
+
const ruleName = 'plugin/at-rule-name-space-after';
|
|
12
|
+
|
|
13
|
+
const messages = ruleMessages(ruleName, {
|
|
14
|
+
expectedAfter: (name) => `Expected single space after at-rule name "${name}"`
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const meta = {
|
|
18
|
+
url: 'https://github.com/jens-duttke/linter-bundle/blob/main/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/README.md',
|
|
19
|
+
fixable: true
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
/** @type {import('stylelint').Rule} */
|
|
23
|
+
const rule = (primary, _secondary, context) => {
|
|
24
|
+
const checker = whitespaceChecker('space', primary, messages);
|
|
25
|
+
|
|
26
|
+
return (root, result) => {
|
|
27
|
+
const validOptions = validateOptions(result, ruleName, {
|
|
28
|
+
actual: primary,
|
|
29
|
+
possible: ['always', 'always-single-line']
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
if (!validOptions) {
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
atRuleNameSpaceChecker({
|
|
37
|
+
root,
|
|
38
|
+
result,
|
|
39
|
+
locationChecker: checker.after,
|
|
40
|
+
checkedRuleName: ruleName,
|
|
41
|
+
fix: context.fix ?
|
|
42
|
+
(atRule) => {
|
|
43
|
+
if (typeof atRule.raws.afterName === 'string') {
|
|
44
|
+
atRule.raws.afterName = atRule.raws.afterName.replace(/^\s*/, ' ');
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
: null
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
rule.ruleName = ruleName;
|
|
53
|
+
rule.messages = messages;
|
|
54
|
+
rule.meta = meta;
|
|
55
|
+
module.exports = stylelint.createPlugin(ruleName, rule);
|