linter-bundle 6.3.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.linter-bundle.js +27 -17
- package/.linter-bundle.schema.json +45 -0
- package/CHANGELOG.md +125 -3
- package/README.md +51 -63
- package/eslint/gatsby.mjs +95 -0
- package/eslint/index.mjs +1127 -0
- package/eslint/javascript-lazy.mjs +24 -0
- package/eslint/javascript.mjs +126 -0
- package/eslint/jest.mjs +172 -0
- package/eslint/jsdoc.mjs +103 -0
- package/eslint/react.mjs +232 -0
- package/eslint/rules/no-unnecessary-typeof.md +1 -1
- package/eslint/rules/{no-unnecessary-typeof.js → no-unnecessary-typeof.mjs} +9 -11
- package/eslint/rules/restricted-filenames.md +4 -4
- package/eslint/rules/{restricted-filenames.js → restricted-filenames.mjs} +7 -6
- package/eslint/storybook.mjs +42 -0
- package/eslint/type-declarations.mjs +49 -0
- package/eslint/{overrides-worker.cjs → worker.mjs} +12 -14
- package/eslint.mjs +5 -0
- package/files/index.js +3 -3
- package/helper/{ensure-type.cjs → ensure-type.mjs} +1 -5
- package/helper/get-outdated-dependencies.js +4 -4
- package/helper/get-outdated-overrides.js +2 -2
- package/helper/get-stylelint-path.js +4 -3
- package/helper/is-npm-or-yarn.js +2 -2
- package/helper/linter-bundle-config.js +9 -14
- package/helper/run-process.js +1 -1
- package/lint.js +21 -16
- package/package.json +31 -29
- package/stylelint/index.mjs +1111 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/{selectors.cjs → selectors.mjs} +15 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/{index.cjs → index.mjs} +6 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/{index.cjs → index.mjs} +11 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/{index.cjs → index.mjs} +18 -22
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{atRuleNameSpaceChecker.cjs → atRuleNameSpaceChecker.mjs} +4 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/{index.cjs → index.mjs} +16 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/{index.cjs → index.mjs} +13 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/{index.cjs → index.mjs} +11 -40
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/{index.cjs → index.mjs} +10 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/{index.cjs → index.mjs} +14 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/{index.cjs → index.mjs} +13 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/{index.cjs → index.mjs} +14 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.mjs +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/{index.cjs → index.mjs} +11 -29
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/{index.cjs → index.mjs} +9 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/{index.cjs → index.mjs} +10 -23
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/{index.cjs → index.mjs} +11 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/{index.cjs → index.mjs} +9 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/{index.cjs → index.mjs} +9 -25
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationBangSpaceChecker.cjs → declarationBangSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationColonSpaceChecker.cjs → declarationColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{findMediaOperator.cjs → findMediaOperator.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/{index.cjs → index.mjs} +19 -39
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/{index.cjs → index.mjs} +19 -54
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/{index.cjs → index.mjs} +21 -68
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/{index.cjs → index.mjs} +16 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceChecker.cjs → functionCommaSpaceChecker.mjs} +8 -7
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceFix.cjs → functionCommaSpaceFix.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/{index.cjs → index.mjs} +39 -64
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/{index.cjs → index.mjs} +15 -44
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/{index.cjs → index.mjs} +10 -49
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/{index.cjs → index.mjs} +9 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/{index.cjs → index.mjs} +8 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaFeatureColonSpaceChecker.cjs → mediaFeatureColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaQueryListCommaWhitespaceChecker.cjs → mediaQueryListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/{index.cjs → index.mjs} +6 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/{index.cjs → index.mjs} +13 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/{index.cjs → index.mjs} +10 -33
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/{index.cjs → index.mjs} +7 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/{index.cjs → index.mjs} +13 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/{index.cjs → index.mjs} +9 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/{index.cjs → index.mjs} +9 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/{index.cjs → index.mjs} +9 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/{index.cjs → index.mjs} +9 -14
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/{index.cjs → index.mjs} +10 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/{index.cjs → index.mjs} +10 -24
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/{index.cjs → index.mjs} +12 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/{index.cjs → index.mjs} +10 -15
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorAttributeOperatorSpaceChecker.cjs → selectorAttributeOperatorSpaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorCombinatorSpaceChecker.cjs → selectorCombinatorSpaceChecker.mjs} +12 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorListCommaWhitespaceChecker.cjs → selectorListCommaWhitespaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/{index.cjs → index.mjs} +43 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/{index.cjs → index.mjs} +5 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/{index.cjs → index.mjs} +17 -34
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/{index.cjs → index.mjs} +12 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{valueListCommaWhitespaceChecker.cjs → valueListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{addEmptyLineAfter.cjs → addEmptyLineAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{hasEmptyBlock.cjs → hasEmptyBlock.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{nextNonCommentNode.cjs → nextNonCommentNode.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{removeEmptyLinesAfter.cjs → removeEmptyLinesAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/transformSelector.mjs +19 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{whitespaceChecker.cjs → whitespaceChecker.mjs} +5 -5
- package/stylelint/plugins/stylelint-selector-no-empty.js +2 -0
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +2 -2
- package/stylelint.mjs +6 -0
- package/TODO.md +0 -58
- package/eslint/index.cjs +0 -1071
- package/eslint/overrides-gatsby.cjs +0 -108
- package/eslint/overrides-javascript-lazy.cjs +0 -27
- package/eslint/overrides-javascript.cjs +0 -121
- package/eslint/overrides-jest.cjs +0 -144
- package/eslint/overrides-jsdoc.cjs +0 -94
- package/eslint/overrides-react.cjs +0 -220
- package/eslint/overrides-storybook.cjs +0 -44
- package/eslint/overrides-type-declarations.cjs +0 -51
- package/eslint/rules/no-global-undefined-check.js +0 -85
- package/eslint/rules/no-global-undefined-check.md +0 -34
- package/eslint.cjs +0 -5
- package/stylelint/index.cjs +0 -1104
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.cjs +0 -95
- package/stylelint.cjs +0 -5
|
@@ -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 isStandardSyntaxRule from 'stylelint/lib/utils/isStandardSyntaxRule.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 {{
|
|
@@ -17,7 +17,7 @@ const styleSearch = require('../style-search/index.cjs');
|
|
|
17
17
|
* @param options
|
|
18
18
|
* @returns {void}
|
|
19
19
|
*/
|
|
20
|
-
|
|
20
|
+
export default function selectorListCommaWhitespaceChecker (options) {
|
|
21
21
|
options.root.walkRules((rule) => {
|
|
22
22
|
if (!isStandardSyntaxRule(rule)) {
|
|
23
23
|
return;
|
|
@@ -55,6 +55,7 @@ module.exports = function selectorListCommaWhitespaceChecker (options) {
|
|
|
55
55
|
message,
|
|
56
56
|
node,
|
|
57
57
|
index,
|
|
58
|
+
endIndex: index,
|
|
58
59
|
result: options.result,
|
|
59
60
|
ruleName: options.checkedRuleName
|
|
60
61
|
});
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/{index.cjs → index.mjs}
RENAMED
|
@@ -1,17 +1,16 @@
|
|
|
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
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const { isBoolean, assertString } = require('stylelint/lib/utils/validateTypes.cjs');
|
|
4
|
+
import valueParser from 'postcss-value-parser';
|
|
5
|
+
import stylelint from 'stylelint';
|
|
6
|
+
import { atRuleParamIndex, declarationValueIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
7
|
+
import isStandardSyntaxRule from 'stylelint/lib/utils/isStandardSyntaxRule.mjs';
|
|
8
|
+
import parseSelector from 'stylelint/lib/utils/parseSelector.mjs';
|
|
9
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
10
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
11
|
+
import { isAtRule } from 'stylelint/lib/utils/typeGuards.mjs';
|
|
12
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
13
|
+
import { isBoolean, assertString } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
15
14
|
|
|
16
15
|
const ruleName = 'plugin/string-quotes';
|
|
17
16
|
|
|
@@ -106,19 +105,14 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
106
105
|
}
|
|
107
106
|
|
|
108
107
|
if (needsCorrectEscape) {
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
index: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
118
|
-
result,
|
|
119
|
-
ruleName
|
|
120
|
-
});
|
|
121
|
-
}
|
|
108
|
+
report({
|
|
109
|
+
message: messages.expected(primary === 'single' ? 'double' : primary),
|
|
110
|
+
node: ruleNode,
|
|
111
|
+
index: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
112
|
+
endIndex: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
113
|
+
result,
|
|
114
|
+
ruleName
|
|
115
|
+
});
|
|
122
116
|
}
|
|
123
117
|
}
|
|
124
118
|
|
|
@@ -129,19 +123,14 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
129
123
|
const needsOtherEscape = attributeNode.value.includes(erroneousQuote);
|
|
130
124
|
|
|
131
125
|
if (needsOtherEscape) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
index: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
141
|
-
result,
|
|
142
|
-
ruleName
|
|
143
|
-
});
|
|
144
|
-
}
|
|
126
|
+
report({
|
|
127
|
+
message: messages.expected(primary),
|
|
128
|
+
node: ruleNode,
|
|
129
|
+
index: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
130
|
+
endIndex: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
131
|
+
result,
|
|
132
|
+
ruleName
|
|
133
|
+
});
|
|
145
134
|
|
|
146
135
|
return;
|
|
147
136
|
}
|
|
@@ -151,19 +140,14 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
151
140
|
}
|
|
152
141
|
}
|
|
153
142
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
index: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
163
|
-
result,
|
|
164
|
-
ruleName
|
|
165
|
-
});
|
|
166
|
-
}
|
|
143
|
+
report({
|
|
144
|
+
message: messages.expected(primary),
|
|
145
|
+
node: ruleNode,
|
|
146
|
+
index: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
147
|
+
endIndex: attributeNode.sourceIndex + attributeNode.offsetOf('value'),
|
|
148
|
+
result,
|
|
149
|
+
ruleName
|
|
150
|
+
});
|
|
167
151
|
}
|
|
168
152
|
});
|
|
169
153
|
|
|
@@ -211,20 +195,14 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
211
195
|
const openIndex = valueNode.sourceIndex;
|
|
212
196
|
|
|
213
197
|
// we currently don't fix escapes
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
node,
|
|
223
|
-
index: getIndex(node) + openIndex,
|
|
224
|
-
result,
|
|
225
|
-
ruleName
|
|
226
|
-
});
|
|
227
|
-
}
|
|
198
|
+
report({
|
|
199
|
+
message: messages.expected(primary),
|
|
200
|
+
node,
|
|
201
|
+
index: getIndex(node) + openIndex,
|
|
202
|
+
endIndex: getIndex(node) + openIndex,
|
|
203
|
+
result,
|
|
204
|
+
ruleName
|
|
205
|
+
});
|
|
228
206
|
}
|
|
229
207
|
});
|
|
230
208
|
|
|
@@ -253,4 +231,4 @@ function replaceQuote (string, index, replace) {
|
|
|
253
231
|
rule.ruleName = ruleName;
|
|
254
232
|
rule.messages = messages;
|
|
255
233
|
rule.meta = meta;
|
|
256
|
-
|
|
234
|
+
export default stylelint.createPlugin(ruleName, rule);
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/{index.cjs → index.mjs}
RENAMED
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
6
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
7
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
8
8
|
|
|
9
9
|
const ruleName = 'plugin/unicode-bom';
|
|
10
10
|
|
|
@@ -64,4 +64,4 @@ const rule = (primary) => (root, result) => {
|
|
|
64
64
|
rule.ruleName = ruleName;
|
|
65
65
|
rule.messages = messages;
|
|
66
66
|
rule.meta = meta;
|
|
67
|
-
|
|
67
|
+
export default stylelint.createPlugin(ruleName, rule);
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/{index.cjs → index.mjs}
RENAMED
|
@@ -1,14 +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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const validateOptions = require('stylelint/lib/utils/validateOptions.cjs');
|
|
4
|
+
import valueParser from 'postcss-value-parser';
|
|
5
|
+
import stylelint from 'stylelint';
|
|
6
|
+
import { atRuleParamIndex, declarationValueIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
7
|
+
import getDimension from 'stylelint/lib/utils/getDimension.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';
|
|
12
11
|
|
|
13
12
|
const ruleName = 'plugin/unit-case';
|
|
14
13
|
|
|
@@ -85,34 +84,18 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
85
84
|
value: value_
|
|
86
85
|
}));
|
|
87
86
|
}
|
|
88
|
-
|
|
89
|
-
needFix = processValue(valueNode);
|
|
90
|
-
|
|
91
|
-
if (needFix && context.fix) {
|
|
92
|
-
valueNode.value = primary === 'lower' ? value.toLowerCase() : value.toUpperCase();
|
|
93
|
-
}
|
|
94
87
|
});
|
|
95
88
|
|
|
96
89
|
if (problems.length > 0) {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
node
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
for (const error of problems) {
|
|
107
|
-
report({
|
|
108
|
-
index: error.index,
|
|
109
|
-
endIndex: error.endIndex,
|
|
110
|
-
message: error.message,
|
|
111
|
-
node,
|
|
112
|
-
result,
|
|
113
|
-
ruleName
|
|
114
|
-
});
|
|
115
|
-
}
|
|
90
|
+
for (const error of problems) {
|
|
91
|
+
report({
|
|
92
|
+
index: error.index,
|
|
93
|
+
endIndex: error.endIndex,
|
|
94
|
+
message: error.message,
|
|
95
|
+
node,
|
|
96
|
+
result,
|
|
97
|
+
ruleName
|
|
98
|
+
});
|
|
116
99
|
}
|
|
117
100
|
}
|
|
118
101
|
}
|
|
@@ -130,4 +113,4 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
130
113
|
rule.ruleName = ruleName;
|
|
131
114
|
rule.messages = messages;
|
|
132
115
|
rule.meta = meta;
|
|
133
|
-
|
|
116
|
+
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
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { declarationValueIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import getDeclarationValue from 'stylelint/lib/utils/getDeclarationValue.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import setDeclarationValue from 'stylelint/lib/utils/setDeclarationValue.mjs';
|
|
9
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
12
|
+
import valueListCommaWhitespaceChecker from '../valueListCommaWhitespaceChecker.mjs';
|
|
13
13
|
|
|
14
14
|
const ruleName = 'plugin/value-list-comma-newline-after';
|
|
15
15
|
|
|
@@ -46,7 +46,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
46
46
|
result,
|
|
47
47
|
locationChecker: checker.afterOneOnly,
|
|
48
48
|
checkedRuleName: ruleName,
|
|
49
|
-
fix:
|
|
49
|
+
fix:
|
|
50
50
|
(declNode, index) => {
|
|
51
51
|
const valueIndex = declarationValueIndex(declNode);
|
|
52
52
|
|
|
@@ -61,8 +61,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
61
61
|
fixData.set(declNode, commaIndices);
|
|
62
62
|
|
|
63
63
|
return true;
|
|
64
|
-
}
|
|
65
|
-
: null,
|
|
64
|
+
},
|
|
66
65
|
determineIndex: (declString, match) => {
|
|
67
66
|
const nextChars = declString.substring(match.endIndex, declString.length);
|
|
68
67
|
|
|
@@ -104,4 +103,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
104
103
|
rule.ruleName = ruleName;
|
|
105
104
|
rule.messages = messages;
|
|
106
105
|
rule.meta = meta;
|
|
107
|
-
|
|
106
|
+
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 valueListCommaWhitespaceChecker from '../valueListCommaWhitespaceChecker.mjs';
|
|
10
10
|
|
|
11
11
|
const ruleName = 'plugin/value-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,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
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { declarationValueIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import getDeclarationValue from 'stylelint/lib/utils/getDeclarationValue.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import setDeclarationValue from 'stylelint/lib/utils/setDeclarationValue.mjs';
|
|
9
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
12
|
+
import valueListCommaWhitespaceChecker from '../valueListCommaWhitespaceChecker.mjs';
|
|
13
13
|
|
|
14
14
|
const ruleName = 'plugin/value-list-comma-space-after';
|
|
15
15
|
|
|
@@ -47,7 +47,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
47
47
|
result,
|
|
48
48
|
locationChecker: checker.after,
|
|
49
49
|
checkedRuleName: ruleName,
|
|
50
|
-
fix:
|
|
50
|
+
fix:
|
|
51
51
|
(declNode, index) => {
|
|
52
52
|
const valueIndex = declarationValueIndex(declNode);
|
|
53
53
|
|
|
@@ -63,7 +63,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
63
63
|
|
|
64
64
|
return true;
|
|
65
65
|
}
|
|
66
|
-
: null
|
|
67
66
|
});
|
|
68
67
|
|
|
69
68
|
if (fixData) {
|
|
@@ -91,4 +90,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
91
90
|
rule.ruleName = ruleName;
|
|
92
91
|
rule.messages = messages;
|
|
93
92
|
rule.meta = meta;
|
|
94
|
-
|
|
93
|
+
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
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { declarationValueIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import getDeclarationValue from 'stylelint/lib/utils/getDeclarationValue.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import setDeclarationValue from 'stylelint/lib/utils/setDeclarationValue.mjs';
|
|
9
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
12
|
+
import valueListCommaWhitespaceChecker from '../valueListCommaWhitespaceChecker.mjs';
|
|
13
13
|
|
|
14
14
|
const ruleName = 'plugin/value-list-comma-space-before';
|
|
15
15
|
|
|
@@ -47,7 +47,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
47
47
|
result,
|
|
48
48
|
locationChecker: checker.before,
|
|
49
49
|
checkedRuleName: ruleName,
|
|
50
|
-
fix:
|
|
50
|
+
fix:
|
|
51
51
|
(declNode, index) => {
|
|
52
52
|
const valueIndex = declarationValueIndex(declNode);
|
|
53
53
|
|
|
@@ -63,7 +63,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
63
63
|
|
|
64
64
|
return true;
|
|
65
65
|
}
|
|
66
|
-
: null
|
|
67
66
|
});
|
|
68
67
|
|
|
69
68
|
if (fixData) {
|
|
@@ -91,4 +90,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
91
90
|
rule.ruleName = ruleName;
|
|
92
91
|
rule.messages = messages;
|
|
93
92
|
rule.meta = meta;
|
|
94
|
-
|
|
93
|
+
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
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import getDeclarationValue from 'stylelint/lib/utils/getDeclarationValue.mjs';
|
|
6
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import setDeclarationValue from 'stylelint/lib/utils/setDeclarationValue.mjs';
|
|
9
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
10
|
+
import{ isNumber } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/value-list-max-empty-lines';
|
|
13
13
|
|
|
@@ -36,24 +36,18 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
36
36
|
|
|
37
37
|
const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`);
|
|
38
38
|
const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`);
|
|
39
|
-
const allowedLFNewLinesString =
|
|
40
|
-
const allowedCRLFNewLinesString =
|
|
39
|
+
const allowedLFNewLinesString = '';
|
|
40
|
+
const allowedCRLFNewLinesString = '';
|
|
41
41
|
|
|
42
42
|
root.walkDecls((decl) => {
|
|
43
43
|
const value = getDeclarationValue(decl);
|
|
44
44
|
|
|
45
|
-
if (
|
|
46
|
-
const newValueString = value
|
|
47
|
-
.replace(new RegExp(violatedLFNewLinesRegex, 'gm'), allowedLFNewLinesString)
|
|
48
|
-
.replace(new RegExp(violatedCRLFNewLinesRegex, 'gm'), allowedCRLFNewLinesString);
|
|
49
|
-
|
|
50
|
-
setDeclarationValue(decl, newValueString);
|
|
51
|
-
}
|
|
52
|
-
else if (violatedLFNewLinesRegex.test(value) || violatedCRLFNewLinesRegex.test(value)) {
|
|
45
|
+
if (violatedLFNewLinesRegex.test(value) || violatedCRLFNewLinesRegex.test(value)) {
|
|
53
46
|
report({
|
|
54
47
|
message: messages.expected(primary),
|
|
55
48
|
node: decl,
|
|
56
49
|
index: 0,
|
|
50
|
+
endIndex: 0,
|
|
57
51
|
result,
|
|
58
52
|
ruleName
|
|
59
53
|
});
|
|
@@ -65,4 +59,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
65
59
|
rule.ruleName = ruleName;
|
|
66
60
|
rule.messages = messages;
|
|
67
61
|
rule.meta = meta;
|
|
68
|
-
|
|
62
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,11 +1,11 @@
|
|
|
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 isStandardSyntaxDeclaration from 'stylelint/lib/utils/isStandardSyntaxDeclaration.mjs';
|
|
5
|
+
import isStandardSyntaxProperty from 'stylelint/lib/utils/isStandardSyntaxProperty.mjs';
|
|
6
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
import styleSearch from '../style-search/index.mjs';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* @param {{
|
|
@@ -18,7 +18,7 @@ const styleSearch = require('../style-search/index.cjs');
|
|
|
18
18
|
* }} opts
|
|
19
19
|
* @param options
|
|
20
20
|
*/
|
|
21
|
-
|
|
21
|
+
export default function valueListCommaWhitespaceChecker (options) {
|
|
22
22
|
options.root.walkDecls((decl) => {
|
|
23
23
|
if (!isStandardSyntaxDeclaration(decl) || !isStandardSyntaxProperty(decl.prop)) {
|
|
24
24
|
return;
|
|
@@ -65,6 +65,7 @@ module.exports = function valueListCommaWhitespaceChecker (options) {
|
|
|
65
65
|
message,
|
|
66
66
|
node,
|
|
67
67
|
index,
|
|
68
|
+
endIndex: index,
|
|
68
69
|
result: options.result,
|
|
69
70
|
ruleName: options.checkedRuleName
|
|
70
71
|
});
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{hasEmptyBlock.cjs → hasEmptyBlock.mjs}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
import hasBlock from 'stylelint/lib/utils/hasBlock.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Check if a statement has an empty block.
|
|
@@ -9,6 +9,6 @@ const hasBlock = require('stylelint/lib/utils/hasBlock.cjs');
|
|
|
9
9
|
* @param {import('postcss').Rule | import('postcss').AtRule} statement - postcss rule or at-rule node
|
|
10
10
|
* @returns {boolean} True if the statement has a block and it is empty
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
export default function hasEmptyBlock (statement) {
|
|
13
13
|
return hasBlock(statement) && statement.nodes.length === 0;
|
|
14
14
|
};
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
* @param {PostcssNode | void} startNode
|
|
11
11
|
* @returns {PostcssNode | null}
|
|
12
12
|
*/
|
|
13
|
-
|
|
13
|
+
export default function nextNonCommentNode (startNode) {
|
|
14
14
|
if (!startNode || !startNode.next) { return null; }
|
|
15
15
|
|
|
16
16
|
if (startNode.type === 'comment') {
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* @param {string} newline
|
|
10
10
|
* @returns {T}
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
export default function removeEmptyLinesAfter (node, newline) {
|
|
13
13
|
node.raws.after = node.raws.after ? node.raws.after.replace(/(\r?\n\s*\n)+/g, newline) : '';
|
|
14
14
|
|
|
15
15
|
return node;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
|
+
|
|
3
|
+
import selectorParser from 'postcss-selector-parser';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* @param {import('stylelint').PostcssResult} result
|
|
7
|
+
* @param {import('postcss').Rule} node
|
|
8
|
+
* @param {(root: import('postcss-selector-parser').Root) => void} callback
|
|
9
|
+
* @returns {string | undefined}
|
|
10
|
+
*/
|
|
11
|
+
export default function transformSelector(result, node, callback) {
|
|
12
|
+
try {
|
|
13
|
+
return selectorParser(callback).processSync(node, { updateSelector: true });
|
|
14
|
+
} catch {
|
|
15
|
+
result.warn('Cannot parse selector', { node, stylelintType: 'parseError' });
|
|
16
|
+
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -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
|
-
|
|
6
|
-
|
|
7
|
-
|
|
4
|
+
import configurationError from 'stylelint/lib/utils/configurationError.mjs';
|
|
5
|
+
import isSingleLineString from 'stylelint/lib/utils/isSingleLineString.mjs';
|
|
6
|
+
import isWhitespace from 'stylelint/lib/utils/isWhitespace.mjs';
|
|
7
|
+
import { assertFunction, isNullish } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* @typedef {(message: string) => string} MessageFunction
|
|
@@ -80,7 +80,7 @@ const { assertFunction, isNullish } = require('stylelint/lib/utils/validateTypes
|
|
|
80
80
|
*
|
|
81
81
|
* @returns {WhitespaceCheckers} The checker, with its exposed checking functions
|
|
82
82
|
*/
|
|
83
|
-
|
|
83
|
+
export default function whitespaceChecker (targetWhitespace, expectation, messages) {
|
|
84
84
|
// Keep track of active arguments in order to avoid passing
|
|
85
85
|
// too much stuff around, making signatures long and confusing.
|
|
86
86
|
// This variable gets reset anytime a checking function is called.
|