linter-bundle 6.2.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.linter-bundle.js +27 -17
- package/.linter-bundle.schema.json +45 -0
- package/CHANGELOG.md +149 -4
- package/README.md +60 -63
- package/eslint/gatsby.mjs +95 -0
- package/eslint/index.mjs +1127 -0
- package/eslint/javascript-lazy.mjs +24 -0
- package/eslint/javascript.mjs +126 -0
- package/eslint/jest.mjs +172 -0
- package/eslint/jsdoc.mjs +103 -0
- package/eslint/react.mjs +232 -0
- package/eslint/rules/no-unnecessary-typeof.md +1 -1
- package/eslint/rules/{no-unnecessary-typeof.js → no-unnecessary-typeof.mjs} +9 -11
- package/eslint/rules/restricted-filenames.md +4 -4
- package/eslint/rules/{restricted-filenames.js → restricted-filenames.mjs} +7 -6
- package/eslint/storybook.mjs +42 -0
- package/eslint/type-declarations.mjs +49 -0
- package/eslint/{overrides-worker.cjs → worker.mjs} +12 -14
- package/eslint.mjs +5 -0
- package/files/index.js +3 -3
- package/helper/{ensure-type.cjs → ensure-type.mjs} +1 -5
- package/helper/get-outdated-dependencies.js +4 -4
- package/helper/get-outdated-overrides.js +2 -2
- package/helper/get-stylelint-path.js +4 -3
- package/helper/is-npm-or-yarn.js +2 -2
- package/helper/linter-bundle-config.d.ts +24 -0
- package/helper/linter-bundle-config.js +9 -14
- package/helper/run-process.js +1 -1
- package/lint.js +21 -16
- package/package.json +31 -29
- package/stylelint/index.mjs +1111 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/{selectors.cjs → selectors.mjs} +15 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/{index.cjs → index.mjs} +6 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/{index.cjs → index.mjs} +11 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/{index.cjs → index.mjs} +18 -22
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{atRuleNameSpaceChecker.cjs → atRuleNameSpaceChecker.mjs} +4 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/{index.cjs → index.mjs} +16 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/{index.cjs → index.mjs} +13 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/{index.cjs → index.mjs} +11 -40
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/{index.cjs → index.mjs} +10 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/{index.cjs → index.mjs} +14 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/{index.cjs → index.mjs} +13 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/{index.cjs → index.mjs} +14 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.mjs +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/{index.cjs → index.mjs} +11 -29
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/{index.cjs → index.mjs} +9 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/{index.cjs → index.mjs} +10 -23
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/{index.cjs → index.mjs} +11 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/{index.cjs → index.mjs} +9 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/{index.cjs → index.mjs} +9 -25
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationBangSpaceChecker.cjs → declarationBangSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationColonSpaceChecker.cjs → declarationColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{findMediaOperator.cjs → findMediaOperator.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/{index.cjs → index.mjs} +19 -39
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/{index.cjs → index.mjs} +19 -54
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/{index.cjs → index.mjs} +21 -68
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/{index.cjs → index.mjs} +16 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceChecker.cjs → functionCommaSpaceChecker.mjs} +8 -7
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceFix.cjs → functionCommaSpaceFix.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/{index.cjs → index.mjs} +39 -64
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/{index.cjs → index.mjs} +15 -44
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/{index.cjs → index.mjs} +10 -49
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/{index.cjs → index.mjs} +9 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/{index.cjs → index.mjs} +8 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaFeatureColonSpaceChecker.cjs → mediaFeatureColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaQueryListCommaWhitespaceChecker.cjs → mediaQueryListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/{index.cjs → index.mjs} +6 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/{index.cjs → index.mjs} +13 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/{index.cjs → index.mjs} +10 -33
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/{index.cjs → index.mjs} +7 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/{index.cjs → index.mjs} +13 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/{index.cjs → index.mjs} +9 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/{index.cjs → index.mjs} +9 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/{index.cjs → index.mjs} +9 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/{index.cjs → index.mjs} +9 -14
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/{index.cjs → index.mjs} +10 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/{index.cjs → index.mjs} +10 -24
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/{index.cjs → index.mjs} +12 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/{index.cjs → index.mjs} +10 -15
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorAttributeOperatorSpaceChecker.cjs → selectorAttributeOperatorSpaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorCombinatorSpaceChecker.cjs → selectorCombinatorSpaceChecker.mjs} +12 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorListCommaWhitespaceChecker.cjs → selectorListCommaWhitespaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/{index.cjs → index.mjs} +43 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/{index.cjs → index.mjs} +5 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/{index.cjs → index.mjs} +17 -34
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/{index.cjs → index.mjs} +12 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{valueListCommaWhitespaceChecker.cjs → valueListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{addEmptyLineAfter.cjs → addEmptyLineAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{hasEmptyBlock.cjs → hasEmptyBlock.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{nextNonCommentNode.cjs → nextNonCommentNode.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{removeEmptyLinesAfter.cjs → removeEmptyLinesAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/transformSelector.mjs +19 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{whitespaceChecker.cjs → whitespaceChecker.mjs} +5 -5
- package/stylelint/plugins/stylelint-selector-no-empty.js +2 -0
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +2 -2
- package/stylelint.mjs +6 -0
- package/TODO.md +0 -58
- package/eslint/index.cjs +0 -1065
- package/eslint/overrides-gatsby.cjs +0 -108
- package/eslint/overrides-javascript-lazy.cjs +0 -27
- package/eslint/overrides-javascript.cjs +0 -121
- package/eslint/overrides-jest.cjs +0 -144
- package/eslint/overrides-jsdoc.cjs +0 -94
- package/eslint/overrides-react.cjs +0 -220
- package/eslint/overrides-storybook.cjs +0 -44
- package/eslint/overrides-type-declarations.cjs +0 -51
- package/eslint/rules/no-global-undefined-check.js +0 -85
- package/eslint/rules/no-global-undefined-check.md +0 -34
- package/eslint.cjs +0 -5
- package/stylelint/index.cjs +0 -1104
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.cjs +0 -95
- package/stylelint.cjs +0 -5
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/{index.cjs → index.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import optionsMatches from 'stylelint/lib/utils/optionsMatches.mjs';
|
|
6
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
9
|
+
import{ isNumber } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import styleSearch from '../../style-search/index.mjs';
|
|
12
12
|
|
|
13
13
|
const ruleName = 'plugin/max-empty-lines';
|
|
14
14
|
|
|
@@ -50,47 +50,6 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
50
50
|
const ignoreComments = optionsMatches(secondaryOptions, 'ignore', 'comments');
|
|
51
51
|
const getChars = replaceEmptyLines.bind(null, primary);
|
|
52
52
|
|
|
53
|
-
/**
|
|
54
|
-
* 1. walk nodes & replace enterchar
|
|
55
|
-
* 2. deal with special case.
|
|
56
|
-
*/
|
|
57
|
-
if (context.fix) {
|
|
58
|
-
root.walk((node) => {
|
|
59
|
-
if (node.type === 'comment' && !ignoreComments) {
|
|
60
|
-
node.raws.left = getChars(node.raws.left);
|
|
61
|
-
node.raws.right = getChars(node.raws.right);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
if (node.raws.before) {
|
|
65
|
-
node.raws.before = getChars(node.raws.before);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
// first node
|
|
70
|
-
const firstNodeRawsBefore = root.first?.raws.before;
|
|
71
|
-
// root raws
|
|
72
|
-
const rootRawsAfter = root.raws.after;
|
|
73
|
-
|
|
74
|
-
// not document node
|
|
75
|
-
// @ts-expect-error -- TS2339: Property 'document' does not exist on type 'Root'.
|
|
76
|
-
if ((root.document?.constructor.name) !== 'Document') {
|
|
77
|
-
if (firstNodeRawsBefore) {
|
|
78
|
-
root.first.raws.before = getChars(firstNodeRawsBefore, true);
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
if (rootRawsAfter) {
|
|
82
|
-
// when max set 0, should be treated as 1 in this situation.
|
|
83
|
-
root.raws.after = replaceEmptyLines(primary === 0 ? 1 : primary, rootRawsAfter, true);
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
else if (rootRawsAfter) {
|
|
87
|
-
// `css in js` or `html`
|
|
88
|
-
root.raws.after = replaceEmptyLines(primary === 0 ? 1 : primary, rootRawsAfter);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
53
|
emptyLines = 0;
|
|
95
54
|
lastIndex = -1;
|
|
96
55
|
const rootString = root.toString();
|
|
@@ -135,6 +94,7 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
135
94
|
message: messages.expected(primary),
|
|
136
95
|
node,
|
|
137
96
|
index: matchStartIndex,
|
|
97
|
+
endIndex: matchStartIndex,
|
|
138
98
|
result,
|
|
139
99
|
ruleName
|
|
140
100
|
});
|
|
@@ -149,6 +109,7 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
149
109
|
message: messages.expected(primary),
|
|
150
110
|
node,
|
|
151
111
|
index: matchEndIndex,
|
|
112
|
+
endIndex: matchEndIndex,
|
|
152
113
|
result,
|
|
153
114
|
ruleName
|
|
154
115
|
});
|
|
@@ -222,4 +183,4 @@ function isEofNode (document, root) {
|
|
|
222
183
|
rule.ruleName = ruleName;
|
|
223
184
|
rule.messages = messages;
|
|
224
185
|
rule.meta = meta;
|
|
225
|
-
|
|
186
|
+
export default stylelint.createPlugin(ruleName, rule);
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/{index.cjs → index.mjs}
RENAMED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import optionsMatches from 'stylelint/lib/utils/optionsMatches.mjs';
|
|
6
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
9
|
+
import { isNumber, isRegExp, isString, assert } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
import styleSearch from '../../style-search/index.mjs';
|
|
12
12
|
|
|
13
13
|
const ruleName = 'plugin/max-line-length';
|
|
14
14
|
|
|
@@ -54,7 +54,7 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
54
54
|
|
|
55
55
|
const ignoreNonComments = optionsMatches(secondaryOptions, 'ignore', 'non-comments');
|
|
56
56
|
const ignoreComments = optionsMatches(secondaryOptions, 'ignore', 'comments');
|
|
57
|
-
const rootString =
|
|
57
|
+
const rootString = root.source.input.css;
|
|
58
58
|
// Array of skipped sub strings, i.e `url(...)`, `@import "..."`
|
|
59
59
|
/** @type {Array<[number, number]>} */
|
|
60
60
|
let skippedSubStrings = [];
|
|
@@ -82,6 +82,7 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
82
82
|
function complain (index) {
|
|
83
83
|
report({
|
|
84
84
|
index,
|
|
85
|
+
endIndex: index,
|
|
85
86
|
result,
|
|
86
87
|
ruleName,
|
|
87
88
|
message: messages.expected(primary),
|
|
@@ -197,4 +198,4 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
197
198
|
rule.ruleName = ruleName;
|
|
198
199
|
rule.messages = messages;
|
|
199
200
|
rule.meta = meta;
|
|
200
|
-
|
|
201
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
7
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
10
|
+
import mediaFeatureColonSpaceChecker from '../mediaFeatureColonSpaceChecker.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/media-feature-colon-space-after';
|
|
13
13
|
|
|
@@ -43,7 +43,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
43
43
|
result,
|
|
44
44
|
locationChecker: checker.after,
|
|
45
45
|
checkedRuleName: ruleName,
|
|
46
|
-
fix:
|
|
46
|
+
fix:
|
|
47
47
|
(atRule, index) => {
|
|
48
48
|
const parameterColonIndex = index - atRuleParamIndex(atRule);
|
|
49
49
|
|
|
@@ -55,7 +55,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
55
55
|
|
|
56
56
|
return true;
|
|
57
57
|
}
|
|
58
|
-
: null
|
|
59
58
|
});
|
|
60
59
|
|
|
61
60
|
if (fixData) {
|
|
@@ -88,4 +87,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
88
87
|
rule.ruleName = ruleName;
|
|
89
88
|
rule.messages = messages;
|
|
90
89
|
rule.meta = meta;
|
|
91
|
-
|
|
90
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
7
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
10
|
+
import mediaFeatureColonSpaceChecker from '../mediaFeatureColonSpaceChecker.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/media-feature-colon-space-before';
|
|
13
13
|
|
|
@@ -43,7 +43,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
43
43
|
result,
|
|
44
44
|
locationChecker: checker.before,
|
|
45
45
|
checkedRuleName: ruleName,
|
|
46
|
-
fix:
|
|
46
|
+
fix:
|
|
47
47
|
(atRule, index) => {
|
|
48
48
|
const parameterColonIndex = index - atRuleParamIndex(atRule);
|
|
49
49
|
|
|
@@ -55,7 +55,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
55
55
|
|
|
56
56
|
return true;
|
|
57
57
|
}
|
|
58
|
-
: null
|
|
59
58
|
});
|
|
60
59
|
|
|
61
60
|
if (fixData) {
|
|
@@ -88,4 +87,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
88
87
|
rule.ruleName = ruleName;
|
|
89
88
|
rule.messages = messages;
|
|
90
89
|
rule.meta = meta;
|
|
91
|
-
|
|
90
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import findMediaFeatureNames from 'stylelint/lib/utils/findMediaFeatureNames.mjs';
|
|
7
|
+
import isCustomMediaQuery from 'stylelint/lib/utils/isCustomMediaQuery.mjs';
|
|
8
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
9
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
10
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
import { mutateIdent } from '@csstools/css-tokenizer';
|
|
13
13
|
|
|
14
14
|
const ruleName = 'plugin/media-feature-name-case';
|
|
15
15
|
|
|
@@ -53,13 +53,6 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
53
53
|
return;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
if (context.fix) {
|
|
57
|
-
mutateIdent(mediaFeatureNameToken, expectedFeatureName);
|
|
58
|
-
hasFixes = true;
|
|
59
|
-
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
56
|
const atRuleIndex = atRuleParamIndex(atRule);
|
|
64
57
|
|
|
65
58
|
report({
|
|
@@ -90,4 +83,4 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
90
83
|
rule.ruleName = ruleName;
|
|
91
84
|
rule.messages = messages;
|
|
92
85
|
rule.meta = meta;
|
|
93
|
-
|
|
86
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
4
|
+
import valueParser from 'postcss-value-parser';
|
|
5
|
+
import stylelint from 'stylelint';
|
|
6
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
7
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
8
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
9
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
10
10
|
|
|
11
11
|
const ruleName = 'plugin/media-feature-parentheses-space-inside';
|
|
12
12
|
|
|
@@ -47,8 +47,6 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
47
47
|
|
|
48
48
|
if (primary === 'never') {
|
|
49
49
|
if ((/[\t ]/).test(node.before)) {
|
|
50
|
-
if (context.fix) { node.before = ''; }
|
|
51
|
-
|
|
52
50
|
problems.push({
|
|
53
51
|
message: messages.rejectedOpening,
|
|
54
52
|
index: node.sourceIndex + 1 + indexBoost
|
|
@@ -56,8 +54,6 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
56
54
|
}
|
|
57
55
|
|
|
58
56
|
if ((/[\t ]/).test(node.after)) {
|
|
59
|
-
if (context.fix) { node.after = ''; }
|
|
60
|
-
|
|
61
57
|
problems.push({
|
|
62
58
|
message: messages.rejectedClosing,
|
|
63
59
|
index: node.sourceIndex - 2 + length_ + indexBoost
|
|
@@ -66,8 +62,6 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
66
62
|
}
|
|
67
63
|
else if (primary === 'always') {
|
|
68
64
|
if (node.before === '') {
|
|
69
|
-
if (context.fix) { node.before = ' '; }
|
|
70
|
-
|
|
71
65
|
problems.push({
|
|
72
66
|
message: messages.expectedOpening,
|
|
73
67
|
index: node.sourceIndex + 1 + indexBoost
|
|
@@ -75,8 +69,6 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
75
69
|
}
|
|
76
70
|
|
|
77
71
|
if (node.after === '') {
|
|
78
|
-
if (context.fix) { node.after = ' '; }
|
|
79
|
-
|
|
80
72
|
problems.push({
|
|
81
73
|
message: messages.expectedClosing,
|
|
82
74
|
index: node.sourceIndex - 2 + length_ + indexBoost
|
|
@@ -87,17 +79,12 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
87
79
|
});
|
|
88
80
|
|
|
89
81
|
if (problems.length > 0) {
|
|
90
|
-
if (context.fix) {
|
|
91
|
-
atRule.params = parsedParameters.toString();
|
|
92
|
-
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
82
|
for (const error of problems) {
|
|
97
83
|
report({
|
|
98
84
|
message: error.message,
|
|
99
85
|
node: atRule,
|
|
100
86
|
index: error.index,
|
|
87
|
+
endIndex: error.index,
|
|
101
88
|
result,
|
|
102
89
|
ruleName
|
|
103
90
|
});
|
|
@@ -109,4 +96,4 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
109
96
|
rule.ruleName = ruleName;
|
|
110
97
|
rule.messages = messages;
|
|
111
98
|
rule.meta = meta;
|
|
112
|
-
|
|
99
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
11
|
+
import findMediaOperator from '../findMediaOperator.mjs';
|
|
12
12
|
|
|
13
13
|
const ruleName = 'plugin/media-feature-range-operator-space-after';
|
|
14
14
|
|
|
@@ -39,11 +39,9 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
39
39
|
root.walkAtRules(/^media$/i, (atRule) => {
|
|
40
40
|
/** @type {number[]} */
|
|
41
41
|
const fixOperatorIndices = [];
|
|
42
|
-
/** @type {((index: number) => void) | null} */
|
|
43
|
-
const fix = context.fix ? (index) => fixOperatorIndices.push(index) : null;
|
|
44
42
|
|
|
45
43
|
findMediaOperator(atRule, (match, parameters, node) => {
|
|
46
|
-
checkAfterOperator(match, parameters, node,
|
|
44
|
+
checkAfterOperator(match, parameters, node, null);
|
|
47
45
|
});
|
|
48
46
|
|
|
49
47
|
if (fixOperatorIndices.length > 0) {
|
|
@@ -94,6 +92,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
94
92
|
message: m,
|
|
95
93
|
node,
|
|
96
94
|
index: endIndex + atRuleParamIndex(node) + 1,
|
|
95
|
+
endIndex: endIndex + atRuleParamIndex(node) + 1,
|
|
97
96
|
result,
|
|
98
97
|
ruleName
|
|
99
98
|
});
|
|
@@ -106,4 +105,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
106
105
|
rule.ruleName = ruleName;
|
|
107
106
|
rule.messages = messages;
|
|
108
107
|
rule.meta = meta;
|
|
109
|
-
|
|
108
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
11
|
+
import findMediaOperator from '../findMediaOperator.mjs';
|
|
12
12
|
|
|
13
13
|
const ruleName = 'plugin/media-feature-range-operator-space-before';
|
|
14
14
|
|
|
@@ -39,11 +39,9 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
39
39
|
root.walkAtRules(/^media$/i, (atRule) => {
|
|
40
40
|
/** @type {number[]} */
|
|
41
41
|
const fixOperatorIndices = [];
|
|
42
|
-
/** @type {((index: number) => void) | null} */
|
|
43
|
-
const fix = context.fix ? (index) => fixOperatorIndices.push(index) : null;
|
|
44
42
|
|
|
45
43
|
findMediaOperator(atRule, (match, parameters, node) => {
|
|
46
|
-
checkBeforeOperator(match, parameters, node,
|
|
44
|
+
checkBeforeOperator(match, parameters, node, null);
|
|
47
45
|
});
|
|
48
46
|
|
|
49
47
|
if (fixOperatorIndices.length > 0) {
|
|
@@ -94,6 +92,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
94
92
|
message: m,
|
|
95
93
|
node,
|
|
96
94
|
index: match.startIndex - 1 + atRuleParamIndex(node),
|
|
95
|
+
endIndex: match.startIndex - 1 + atRuleParamIndex(node),
|
|
97
96
|
result,
|
|
98
97
|
ruleName
|
|
99
98
|
});
|
|
@@ -106,4 +105,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
106
105
|
rule.ruleName = ruleName;
|
|
107
106
|
rule.messages = messages;
|
|
108
107
|
rule.meta = meta;
|
|
109
|
-
|
|
108
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
7
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
10
|
+
import mediaQueryListCommaWhitespaceChecker from '../mediaQueryListCommaWhitespaceChecker.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/media-query-list-comma-newline-after';
|
|
13
13
|
|
|
@@ -47,7 +47,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
47
47
|
locationChecker: checker.afterOneOnly,
|
|
48
48
|
checkedRuleName: ruleName,
|
|
49
49
|
allowTrailingComments: primary.startsWith('always'),
|
|
50
|
-
fix:
|
|
50
|
+
fix:
|
|
51
51
|
(atRule, index) => {
|
|
52
52
|
const parameterCommaIndex = index - atRuleParamIndex(atRule);
|
|
53
53
|
|
|
@@ -59,7 +59,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
59
59
|
|
|
60
60
|
return true;
|
|
61
61
|
}
|
|
62
|
-
: null
|
|
63
62
|
});
|
|
64
63
|
|
|
65
64
|
if (fixData) {
|
|
@@ -94,4 +93,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
94
93
|
rule.ruleName = ruleName;
|
|
95
94
|
rule.messages = messages;
|
|
96
95
|
rule.meta = meta;
|
|
97
|
-
|
|
96
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
6
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
9
|
+
import mediaQueryListCommaWhitespaceChecker from '../mediaQueryListCommaWhitespaceChecker.mjs';
|
|
10
10
|
|
|
11
11
|
const ruleName = 'plugin/media-query-list-comma-newline-before';
|
|
12
12
|
|
|
@@ -46,4 +46,4 @@ const rule = (primary) => {
|
|
|
46
46
|
rule.ruleName = ruleName;
|
|
47
47
|
rule.messages = messages;
|
|
48
48
|
rule.meta = meta;
|
|
49
|
-
|
|
49
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
7
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
10
|
+
import mediaQueryListCommaWhitespaceChecker from '../mediaQueryListCommaWhitespaceChecker.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/media-query-list-comma-space-after';
|
|
13
13
|
|
|
@@ -45,7 +45,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
45
45
|
result,
|
|
46
46
|
locationChecker: checker.after,
|
|
47
47
|
checkedRuleName: ruleName,
|
|
48
|
-
fix:
|
|
48
|
+
fix:
|
|
49
49
|
(atRule, index) => {
|
|
50
50
|
const parameterCommaIndex = index - atRuleParamIndex(atRule);
|
|
51
51
|
|
|
@@ -57,7 +57,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
57
57
|
|
|
58
58
|
return true;
|
|
59
59
|
}
|
|
60
|
-
: null
|
|
61
60
|
});
|
|
62
61
|
|
|
63
62
|
if (fixData) {
|
|
@@ -90,4 +89,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
90
89
|
rule.ruleName = ruleName;
|
|
91
90
|
rule.messages = messages;
|
|
92
91
|
rule.meta = meta;
|
|
93
|
-
|
|
92
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
7
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
10
|
+
import mediaQueryListCommaWhitespaceChecker from '../mediaQueryListCommaWhitespaceChecker.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/media-query-list-comma-space-before';
|
|
13
13
|
|
|
@@ -45,7 +45,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
45
45
|
result,
|
|
46
46
|
locationChecker: checker.before,
|
|
47
47
|
checkedRuleName: ruleName,
|
|
48
|
-
fix:
|
|
48
|
+
fix:
|
|
49
49
|
(atRule, index) => {
|
|
50
50
|
const parameterCommaIndex = index - atRuleParamIndex(atRule);
|
|
51
51
|
|
|
@@ -57,7 +57,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
57
57
|
|
|
58
58
|
return true;
|
|
59
59
|
}
|
|
60
|
-
: null
|
|
61
60
|
});
|
|
62
61
|
|
|
63
62
|
if (fixData) {
|
|
@@ -90,4 +89,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
90
89
|
rule.ruleName = ruleName;
|
|
91
90
|
rule.messages = messages;
|
|
92
91
|
rule.meta = meta;
|
|
93
|
-
|
|
92
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
5
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
import styleSearch from '../style-search/index.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @param {{
|
|
@@ -16,7 +16,7 @@ const styleSearch = require('../style-search/index.cjs');
|
|
|
16
16
|
* }} opts
|
|
17
17
|
* @param options
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
export default function mediaFeatureColonSpaceChecker (options) {
|
|
20
20
|
options.root.walkAtRules(/^media$/i, (atRule) => {
|
|
21
21
|
const parameters = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
|
|
22
22
|
|
|
@@ -45,6 +45,7 @@ module.exports = function mediaFeatureColonSpaceChecker (options) {
|
|
|
45
45
|
message,
|
|
46
46
|
node,
|
|
47
47
|
index: colonIndex,
|
|
48
|
+
endIndex: colonIndex,
|
|
48
49
|
result: options.result,
|
|
49
50
|
ruleName: options.checkedRuleName
|
|
50
51
|
});
|