linter-bundle 7.4.0 → 7.5.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/CHANGELOG.md +26 -1
- package/eslint/index.mjs +2 -2
- package/helper/get-git-files.js +8 -10
- package/package.json +11 -11
- package/stylelint/index.mjs +3 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/index.mjs +0 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/selectors.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/index.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/atRuleNameSpaceChecker.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/index.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/index.mjs +4 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/index.mjs +4 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/index.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/index.mjs +4 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declarationBangSpaceChecker.mjs +2 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declarationColonSpaceChecker.mjs +15 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/findMediaOperator.mjs +2 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/index.mjs +5 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/index.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/functionCommaSpaceChecker.mjs +5 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/functionCommaSpaceFix.mjs +2 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/index.mjs +12 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/index.mjs +8 -10
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/index.mjs +12 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/index.mjs +9 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/index.mjs +6 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/mediaFeatureColonSpaceChecker.mjs +3 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/mediaQueryListCommaWhitespaceChecker.mjs +5 -7
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/index.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/index.mjs +2 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/index.mjs +3 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/index.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/index.mjs +8 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/index.mjs +4 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/index.mjs +5 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/index.mjs +5 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/index.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorAttributeOperatorSpaceChecker.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorCombinatorSpaceChecker.mjs +5 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selectorListCommaWhitespaceChecker.mjs +2 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/index.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/index.mjs +4 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/index.mjs +0 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/index.mjs +5 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/valueListCommaWhitespaceChecker.mjs +2 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/index.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/addEmptyLineAfter.mjs +3 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/hasEmptyBlock.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/nextNonCommentNode.mjs +1 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/removeEmptyLinesAfter.mjs +2 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/transformSelector.mjs +3 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/whitespaceChecker.mjs +1 -2
- package/stylelint/plugins/stylelint-selector-no-empty.js +0 -2
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +0 -2
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -36,7 +35,7 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
36
35
|
return;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
|
-
root.walkAtRules(/^media$/
|
|
38
|
+
root.walkAtRules(/^media$/iu, (atRule) => {
|
|
40
39
|
/** @type {number[]} */
|
|
41
40
|
const fixOperatorIndices = [];
|
|
42
41
|
findMediaOperator(atRule, (match, parameters, node) => {
|
|
@@ -51,10 +50,10 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
51
50
|
const afterOperator = parameters.slice(index);
|
|
52
51
|
|
|
53
52
|
if (primary === 'always') {
|
|
54
|
-
parameters = beforeOperator.replace(/\s
|
|
53
|
+
parameters = beforeOperator.replace(/\s*$/u, ' ') + afterOperator;
|
|
55
54
|
}
|
|
56
55
|
else if (primary === 'never') {
|
|
57
|
-
parameters = beforeOperator.replace(/\s
|
|
56
|
+
parameters = beforeOperator.replace(/\s*$/u, '') + afterOperator;
|
|
58
57
|
}
|
|
59
58
|
}
|
|
60
59
|
|
|
@@ -70,15 +69,14 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
70
69
|
/**
|
|
71
70
|
* @param {import('style-search').StyleSearchMatch} match
|
|
72
71
|
* @param {string} params
|
|
73
|
-
* @param parameters
|
|
74
72
|
* @param {import('postcss').AtRule} node
|
|
75
73
|
* @param {((index: number) => void) | null} fix
|
|
76
74
|
*/
|
|
77
|
-
function checkBeforeOperator (match,
|
|
75
|
+
function checkBeforeOperator (match, params, node, fix) {
|
|
78
76
|
// The extra `+ 1` is because the match itself contains
|
|
79
77
|
// the character before the operator
|
|
80
78
|
checker.before({
|
|
81
|
-
source:
|
|
79
|
+
source: params,
|
|
82
80
|
index: match.startIndex,
|
|
83
81
|
err: (m) => {
|
|
84
82
|
report({
|
|
@@ -90,7 +88,7 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
90
88
|
ruleName,
|
|
91
89
|
fix: (fix ? () => {
|
|
92
90
|
fix(match.startIndex);
|
|
93
|
-
}: undefined)
|
|
91
|
+
} : undefined)
|
|
94
92
|
});
|
|
95
93
|
}
|
|
96
94
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -69,12 +68,12 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
69
68
|
const afterComma = parameters.slice(index + 1);
|
|
70
69
|
|
|
71
70
|
if (primary.startsWith('always')) {
|
|
72
|
-
parameters = (/^\s*\n/).test(afterComma) ?
|
|
73
|
-
beforeComma + afterComma.replace(/^[^\S\n\r]
|
|
71
|
+
parameters = (/^\s*\n/u).test(afterComma) ?
|
|
72
|
+
beforeComma + afterComma.replace(/^[^\S\n\r]*/u, '')
|
|
74
73
|
: beforeComma + context.newline + afterComma;
|
|
75
74
|
}
|
|
76
75
|
else if (primary.startsWith('never')) {
|
|
77
|
-
parameters = beforeComma + afterComma.replace(/^\s
|
|
76
|
+
parameters = beforeComma + afterComma.replace(/^\s*/u, '');
|
|
78
77
|
}
|
|
79
78
|
}
|
|
80
79
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -67,10 +66,10 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
67
66
|
const afterComma = parameters.slice(index + 1);
|
|
68
67
|
|
|
69
68
|
if (primary.startsWith('always')) {
|
|
70
|
-
parameters = beforeComma + afterComma.replace(/^\s
|
|
69
|
+
parameters = beforeComma + afterComma.replace(/^\s*/u, ' ');
|
|
71
70
|
}
|
|
72
71
|
else if (primary.startsWith('never')) {
|
|
73
|
-
parameters = beforeComma + afterComma.replace(/^\s
|
|
72
|
+
parameters = beforeComma + afterComma.replace(/^\s*/u, '');
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -67,10 +66,10 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
67
66
|
const afterComma = parameters.slice(index);
|
|
68
67
|
|
|
69
68
|
if (primary.startsWith('always')) {
|
|
70
|
-
parameters = beforeComma.replace(/\s
|
|
69
|
+
parameters = beforeComma.replace(/\s*$/u, ' ') + afterComma;
|
|
71
70
|
}
|
|
72
71
|
else if (primary.startsWith('never')) {
|
|
73
|
-
parameters = beforeComma.replace(/\s
|
|
72
|
+
parameters = beforeComma.replace(/\s*$/u, '') + afterComma;
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/mediaFeatureColonSpaceChecker.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
@@ -13,11 +12,10 @@ import styleSearch from '../style-search/index.mjs';
|
|
|
13
12
|
* fix: ((node: import('postcss').AtRule, index: number) => boolean) | null,
|
|
14
13
|
* result: import('stylelint').PostcssResult,
|
|
15
14
|
* checkedRuleName: string,
|
|
16
|
-
* }}
|
|
17
|
-
* @param options
|
|
15
|
+
* }} options
|
|
18
16
|
*/
|
|
19
17
|
export default function mediaFeatureColonSpaceChecker (options) {
|
|
20
|
-
options.root.walkAtRules(/^media$/
|
|
18
|
+
options.root.walkAtRules(/^media$/ui, (atRule) => {
|
|
21
19
|
const parameters = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
|
|
22
20
|
|
|
23
21
|
styleSearch({ source: parameters, target: ':' }, (match) => {
|
|
@@ -53,4 +51,4 @@ export default function mediaFeatureColonSpaceChecker (options) {
|
|
|
53
51
|
}
|
|
54
52
|
});
|
|
55
53
|
}
|
|
56
|
-
}
|
|
54
|
+
}
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/mediaQueryListCommaWhitespaceChecker.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import { atRuleParamIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
@@ -15,11 +14,10 @@ import styleSearch from '../style-search/index.mjs';
|
|
|
15
14
|
* checkedRuleName: string,
|
|
16
15
|
* fix?: ((atRule: import('postcss').AtRule, index: number) => boolean) | null | undefined,
|
|
17
16
|
* allowTrailingComments?: boolean,
|
|
18
|
-
* }}
|
|
19
|
-
* @param options
|
|
17
|
+
* }} options
|
|
20
18
|
*/
|
|
21
19
|
export default function mediaQueryListCommaWhitespaceChecker (options) {
|
|
22
|
-
options.root.walkAtRules(/^media$/
|
|
20
|
+
options.root.walkAtRules(/^media$/iu, (atRule) => {
|
|
23
21
|
const parameters = atRule.raws.params ? atRule.raws.params.raw : atRule.params;
|
|
24
22
|
|
|
25
23
|
styleSearch({ source: parameters, target: ',' }, (match) => {
|
|
@@ -29,12 +27,12 @@ export default function mediaQueryListCommaWhitespaceChecker (options) {
|
|
|
29
27
|
// if there is a comment on the same line at after the comma, check the space after the comment.
|
|
30
28
|
let execResult;
|
|
31
29
|
|
|
32
|
-
while ((execResult = (/^[^\S\n\r]*\/\*([\S\s]*?)\*\//).exec(parameters.slice(index + 1)))) {
|
|
30
|
+
while ((execResult = (/^[^\S\n\r]*\/\*([\S\s]*?)\*\//u).exec(parameters.slice(index + 1)))) {
|
|
33
31
|
assertString(execResult[0]);
|
|
34
32
|
index += execResult[0].length;
|
|
35
33
|
}
|
|
36
34
|
|
|
37
|
-
if ((execResult = (/^([^\S\n\r]*\/\/[\S\s]*?)\r?\n/).exec(parameters.slice(index + 1)))) {
|
|
35
|
+
if ((execResult = (/^([^\S\n\r]*\/\/[\S\s]*?)\r?\n/u).exec(parameters.slice(index + 1)))) {
|
|
38
36
|
assertString(execResult[1]);
|
|
39
37
|
index += execResult[1].length;
|
|
40
38
|
}
|
|
@@ -68,4 +66,4 @@ export default function mediaQueryListCommaWhitespaceChecker (options) {
|
|
|
68
66
|
}
|
|
69
67
|
});
|
|
70
68
|
}
|
|
71
|
-
}
|
|
69
|
+
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -7,7 +6,7 @@ import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
|
7
6
|
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
8
7
|
|
|
9
8
|
const ruleName = 'plugin/no-empty-first-line';
|
|
10
|
-
const noEmptyFirstLineTest = /^\s*[\n\r]
|
|
9
|
+
const noEmptyFirstLineTest = /^\s*[\n\r]/u;
|
|
11
10
|
|
|
12
11
|
const messages = ruleMessages(ruleName, {
|
|
13
12
|
rejected: 'Unexpected empty line'
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -27,11 +26,10 @@ const whitespacesToReject = new Set([' ', '\t']);
|
|
|
27
26
|
|
|
28
27
|
/**
|
|
29
28
|
* @param {string} str
|
|
30
|
-
* @param string_
|
|
31
29
|
* @returns {string}
|
|
32
30
|
*/
|
|
33
|
-
function fixString (
|
|
34
|
-
return
|
|
31
|
+
function fixString (str) {
|
|
32
|
+
return str.replace(/[\t ]+$/u, '');
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
/**
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -230,16 +229,15 @@ const rule = (primary, _secondaryOptions) => (root, result) => {
|
|
|
230
229
|
|
|
231
230
|
/**
|
|
232
231
|
* @param {string} str
|
|
233
|
-
* @param string_
|
|
234
232
|
* @param {number[]} indices
|
|
235
233
|
* @returns {string}
|
|
236
234
|
*/
|
|
237
|
-
function removeIndices (
|
|
235
|
+
function removeIndices (str, indices) {
|
|
238
236
|
for (const index of indices.reverse()) {
|
|
239
|
-
|
|
237
|
+
str = str.slice(0, index) + str.slice(index + 1);
|
|
240
238
|
}
|
|
241
239
|
|
|
242
|
-
return
|
|
240
|
+
return str;
|
|
243
241
|
}
|
|
244
242
|
};
|
|
245
243
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import valueParser from 'postcss-value-parser';
|
|
@@ -65,7 +64,7 @@ const rule = (primary, _secondaryOptions) => (root, result) => {
|
|
|
65
64
|
|
|
66
65
|
// Check leading zero
|
|
67
66
|
if (primary === 'always') {
|
|
68
|
-
const match = (/(?:\D|^)(\.\d+)/).exec(valueNode.value);
|
|
67
|
+
const match = (/(?:\D|^)(\.\d+)/u).exec(valueNode.value);
|
|
69
68
|
|
|
70
69
|
if (match?.[0] == null || match[1] == null) {
|
|
71
70
|
return;
|
|
@@ -90,7 +89,7 @@ const rule = (primary, _secondaryOptions) => (root, result) => {
|
|
|
90
89
|
}
|
|
91
90
|
|
|
92
91
|
if (primary === 'never') {
|
|
93
|
-
const match = (/(?:\D|^)(0+)(\.\d+)/).exec(valueNode.value);
|
|
92
|
+
const match = (/(?:\D|^)(0+)(\.\d+)/u).exec(valueNode.value);
|
|
94
93
|
|
|
95
94
|
if (match?.[0] == null || match[1] == null || match[2] == null) {
|
|
96
95
|
return;
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import valueParser from 'postcss-value-parser';
|
|
@@ -62,7 +61,7 @@ const rule = (primary, _secondaryOptions) => (root, result) => {
|
|
|
62
61
|
return;
|
|
63
62
|
}
|
|
64
63
|
|
|
65
|
-
const match = (/\.(\d{0,100}?)(0+)(?:\D|$)/).exec(valueNode.value);
|
|
64
|
+
const match = (/\.(\d{0,100}?)(0+)(?:\D|$)/u).exec(valueNode.value);
|
|
66
65
|
|
|
67
66
|
// match[1] is any numbers between the decimal and our trailing zero, could be empty
|
|
68
67
|
// match[2] is our trailing zero(s)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -84,7 +83,6 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
84
83
|
fixBefore(attributeNode);
|
|
85
84
|
}
|
|
86
85
|
});
|
|
87
|
-
|
|
88
86
|
}
|
|
89
87
|
});
|
|
90
88
|
|
|
@@ -105,7 +103,6 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
105
103
|
fixAfter(attributeNode);
|
|
106
104
|
}
|
|
107
105
|
});
|
|
108
|
-
|
|
109
106
|
}
|
|
110
107
|
|
|
111
108
|
if (!previousCharIsSpace && primary === 'always') {
|
|
@@ -121,7 +118,6 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
121
118
|
fixAfter(attributeNode);
|
|
122
119
|
}
|
|
123
120
|
});
|
|
124
|
-
|
|
125
121
|
}
|
|
126
122
|
});
|
|
127
123
|
});
|
|
@@ -152,7 +148,7 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
152
148
|
setAttrBefore (fixed) {
|
|
153
149
|
spacesAttribute.before = fixed;
|
|
154
150
|
}
|
|
155
|
-
|
|
151
|
+
}
|
|
156
152
|
: {
|
|
157
153
|
attrBefore:
|
|
158
154
|
(attributeNode.spaces.attribute?.before) || '',
|
|
@@ -161,13 +157,13 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
161
157
|
|
|
162
158
|
attributeNode.spaces.attribute.before = fixed;
|
|
163
159
|
}
|
|
164
|
-
|
|
160
|
+
};
|
|
165
161
|
|
|
166
162
|
if (primary === 'always') {
|
|
167
|
-
setAttrBefore(attrBefore.replace(/^\s
|
|
163
|
+
setAttrBefore(attrBefore.replace(/^\s*/u, ' '));
|
|
168
164
|
}
|
|
169
165
|
else if (primary === 'never') {
|
|
170
|
-
setAttrBefore(attrBefore.replace(/^\s
|
|
166
|
+
setAttrBefore(attrBefore.replace(/^\s*/u, ''));
|
|
171
167
|
}
|
|
172
168
|
}
|
|
173
169
|
|
|
@@ -193,7 +189,7 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
193
189
|
setAfter (fixed) {
|
|
194
190
|
rawSpaces.after = fixed;
|
|
195
191
|
}
|
|
196
|
-
|
|
192
|
+
}
|
|
197
193
|
: {
|
|
198
194
|
after: (spaces?.after) || '',
|
|
199
195
|
setAfter (fixed) {
|
|
@@ -202,13 +198,13 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
202
198
|
// @ts-expect-error -- TS2532: Object is possibly 'undefined'.
|
|
203
199
|
attributeNode.spaces[key].after = fixed;
|
|
204
200
|
}
|
|
205
|
-
|
|
201
|
+
};
|
|
206
202
|
|
|
207
203
|
if (primary === 'always') {
|
|
208
|
-
setAfter(after.replace(/\s
|
|
204
|
+
setAfter(after.replace(/\s*$/u, ' '));
|
|
209
205
|
}
|
|
210
206
|
else if (primary === 'never') {
|
|
211
|
-
setAfter(after.replace(/\s
|
|
207
|
+
setAfter(after.replace(/\s*$/u, ''));
|
|
212
208
|
}
|
|
213
209
|
}
|
|
214
210
|
};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -85,13 +84,13 @@ const rule = (primary, _secondaryOptions) => (root, result) => {
|
|
|
85
84
|
})();
|
|
86
85
|
|
|
87
86
|
if (primary === 'always') {
|
|
88
|
-
setOperatorAfter(operatorAfter.replace(/^\s
|
|
87
|
+
setOperatorAfter(operatorAfter.replace(/^\s*/u, ' '));
|
|
89
88
|
|
|
90
89
|
return true;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
92
|
if (primary === 'never') {
|
|
94
|
-
setOperatorAfter(operatorAfter.replace(/^\s
|
|
93
|
+
setOperatorAfter(operatorAfter.replace(/^\s*/u, ''));
|
|
95
94
|
|
|
96
95
|
return true;
|
|
97
96
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -51,7 +50,7 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
51
50
|
setAttrAfter (fixed) {
|
|
52
51
|
rawAttribute.after = fixed;
|
|
53
52
|
}
|
|
54
|
-
|
|
53
|
+
}
|
|
55
54
|
: {
|
|
56
55
|
attrAfter:
|
|
57
56
|
(attributeNode.spaces.attribute?.after) || '',
|
|
@@ -60,16 +59,16 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
60
59
|
|
|
61
60
|
attributeNode.spaces.attribute.after = fixed;
|
|
62
61
|
}
|
|
63
|
-
|
|
62
|
+
};
|
|
64
63
|
|
|
65
64
|
if (primary === 'always') {
|
|
66
|
-
setAttrAfter(attrAfter.replace(/\s
|
|
65
|
+
setAttrAfter(attrAfter.replace(/\s*$/u, ' '));
|
|
67
66
|
|
|
68
67
|
return true;
|
|
69
68
|
}
|
|
70
69
|
|
|
71
70
|
if (primary === 'never') {
|
|
72
|
-
setAttrAfter(attrAfter.replace(/\s
|
|
71
|
+
setAttrAfter(attrAfter.replace(/\s*$/u, ''));
|
|
73
72
|
|
|
74
73
|
return true;
|
|
75
74
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -38,7 +37,7 @@ const rule = (primary, _secondaryOptions) => (root, result) => {
|
|
|
38
37
|
const selector = ruleNode.raws.selector ? ruleNode.raws.selector.raw : ruleNode.selector;
|
|
39
38
|
|
|
40
39
|
// Return early for selectors containing comments
|
|
41
|
-
//
|
|
40
|
+
// @todo re-enable when parser and stylelint are compatible
|
|
42
41
|
if (selector.includes('/*')) { return; }
|
|
43
42
|
|
|
44
43
|
const fixedSelector = parseSelector(selector, result, ruleNode, (fullSelector) => {
|
|
@@ -62,15 +61,15 @@ const rule = (primary, _secondaryOptions) => (root, result) => {
|
|
|
62
61
|
node: ruleNode,
|
|
63
62
|
index: combinatorNode.sourceIndex,
|
|
64
63
|
endIndex: combinatorNode.sourceIndex,
|
|
65
|
-
fix: ((/^\s+$/).test(value) ? () => {
|
|
64
|
+
fix: ((/^\s+$/u).test(value) ? () => {
|
|
66
65
|
hasFixed = true;
|
|
67
66
|
|
|
68
67
|
if (!combinatorNode.raws) { combinatorNode.raws = {}; }
|
|
69
68
|
|
|
70
69
|
combinatorNode.raws.value = ' ';
|
|
71
|
-
combinatorNode.rawSpaceBefore = combinatorNode.rawSpaceBefore.replace(/^\s
|
|
72
|
-
combinatorNode.rawSpaceAfter = combinatorNode.rawSpaceAfter.replace(/\s
|
|
73
|
-
}: undefined)
|
|
70
|
+
combinatorNode.rawSpaceBefore = combinatorNode.rawSpaceBefore.replace(/^\s+/u, '');
|
|
71
|
+
combinatorNode.rawSpaceAfter = combinatorNode.rawSpaceAfter.replace(/\s+$/u, '');
|
|
72
|
+
} : undefined)
|
|
74
73
|
});
|
|
75
74
|
}
|
|
76
75
|
});
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -61,12 +60,12 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
61
60
|
|
|
62
61
|
// If there's a // comment, that means there has to be a newline
|
|
63
62
|
// ending the comment so we're fine
|
|
64
|
-
if ((/^\s+\/\//).test(nextChars)) {
|
|
63
|
+
if ((/^\s+\/\//u).test(nextChars)) {
|
|
65
64
|
return;
|
|
66
65
|
}
|
|
67
66
|
|
|
68
67
|
// If there are spaces and then a comment begins, look for the newline
|
|
69
|
-
const indextoCheckAfter = (/^\s+\/\*/).test(nextChars) ?
|
|
68
|
+
const indextoCheckAfter = (/^\s+\/\*/u).test(nextChars) ?
|
|
70
69
|
selector.indexOf('*/', match.endIndex) + 1
|
|
71
70
|
: match.startIndex;
|
|
72
71
|
|
|
@@ -101,7 +100,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
101
100
|
afterSelector = context.newline + afterSelector;
|
|
102
101
|
}
|
|
103
102
|
else if (primary.startsWith('never-multi-line')) {
|
|
104
|
-
afterSelector = afterSelector.replace(/^\s
|
|
103
|
+
afterSelector = afterSelector.replace(/^\s*/u, '');
|
|
105
104
|
}
|
|
106
105
|
|
|
107
106
|
fixedSelector = beforeSelector + afterSelector;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -63,7 +62,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
63
62
|
const afterSelector = selector.slice(index);
|
|
64
63
|
|
|
65
64
|
if (primary.startsWith('always')) {
|
|
66
|
-
const spaceIndex = beforeSelector.search(/\s+$/);
|
|
65
|
+
const spaceIndex = beforeSelector.search(/\s+$/u);
|
|
67
66
|
|
|
68
67
|
if (spaceIndex >= 0) {
|
|
69
68
|
beforeSelector =
|
|
@@ -76,7 +75,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
76
75
|
}
|
|
77
76
|
}
|
|
78
77
|
else if (primary === 'never-multi-line') {
|
|
79
|
-
beforeSelector = beforeSelector.replace(/\s
|
|
78
|
+
beforeSelector = beforeSelector.replace(/\s*$/u, '');
|
|
80
79
|
}
|
|
81
80
|
|
|
82
81
|
selector = beforeSelector + afterSelector;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -64,10 +63,10 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
64
63
|
let afterSelector = selector.slice(index + 1);
|
|
65
64
|
|
|
66
65
|
if (primary.startsWith('always')) {
|
|
67
|
-
afterSelector = afterSelector.replace(/^\s
|
|
66
|
+
afterSelector = afterSelector.replace(/^\s*/u, ' ');
|
|
68
67
|
}
|
|
69
68
|
else if (primary.startsWith('never')) {
|
|
70
|
-
afterSelector = afterSelector.replace(/^\s
|
|
69
|
+
afterSelector = afterSelector.replace(/^\s*/u, '');
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
selector = beforeSelector + afterSelector;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -64,10 +63,10 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
64
63
|
const afterSelector = selector.slice(index);
|
|
65
64
|
|
|
66
65
|
if (primary.includes('always')) {
|
|
67
|
-
beforeSelector = beforeSelector.replace(/\s
|
|
66
|
+
beforeSelector = beforeSelector.replace(/\s*$/u, ' ');
|
|
68
67
|
}
|
|
69
68
|
else if (primary.includes('never')) {
|
|
70
|
-
beforeSelector = beforeSelector.replace(/\s
|
|
69
|
+
beforeSelector = beforeSelector.replace(/\s*$/u, '');
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
selector = beforeSelector + afterSelector;
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/index.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
5
4
|
import report from 'stylelint/lib/utils/report.mjs';
|
|
6
5
|
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
7
6
|
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
8
|
-
import{ isNumber } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
7
|
+
import { isNumber } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
9
8
|
|
|
10
9
|
const ruleName = 'plugin/selector-max-empty-lines';
|
|
11
10
|
|
|
@@ -32,8 +31,8 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
32
31
|
return;
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}
|
|
36
|
-
const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}
|
|
34
|
+
const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`, 'u');
|
|
35
|
+
const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`, 'u');
|
|
37
36
|
const allowedLFNewLinesString = '\n'.repeat(maxAdjacentNewlines);
|
|
38
37
|
const allowedCRLFNewLinesString = '\r\n'.repeat(maxAdjacentNewlines);
|
|
39
38
|
|
|
@@ -53,8 +52,8 @@ const rule = (primary, _secondaryOptions) => {
|
|
|
53
52
|
ruleName,
|
|
54
53
|
fix: () => {
|
|
55
54
|
const newSelectorString = selector
|
|
56
|
-
.replace(new RegExp(violatedLFNewLinesRegex, '
|
|
57
|
-
.replace(new RegExp(violatedCRLFNewLinesRegex, '
|
|
55
|
+
.replace(new RegExp(violatedLFNewLinesRegex, 'gmu'), allowedLFNewLinesString)
|
|
56
|
+
.replace(new RegExp(violatedCRLFNewLinesRegex, 'gmu'), allowedCRLFNewLinesString);
|
|
58
57
|
|
|
59
58
|
if (ruleNode.raws.selector) {
|
|
60
59
|
ruleNode.raws.selector.raw = newSelectorString;
|
package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/index.mjs
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import stylelint from 'stylelint';
|
|
@@ -6,10 +5,10 @@ import isStandardSyntaxRule from 'stylelint/lib/utils/isStandardSyntaxRule.mjs';
|
|
|
6
5
|
import isStandardSyntaxSelector from 'stylelint/lib/utils/isStandardSyntaxSelector.mjs';
|
|
7
6
|
import report from 'stylelint/lib/utils/report.mjs';
|
|
8
7
|
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
9
|
-
import transformSelector from '../../utils/transformSelector.mjs';
|
|
10
8
|
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
11
9
|
|
|
12
10
|
import { levelOneAndTwoPseudoElements } from '../../reference/selectors.mjs';
|
|
11
|
+
import transformSelector from '../../utils/transformSelector.mjs';
|
|
13
12
|
|
|
14
13
|
const ruleName = 'plugin/selector-pseudo-element-case';
|
|
15
14
|
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
1
|
// @ts-nocheck
|
|
3
2
|
|
|
4
3
|
import isStandardSyntaxRule from 'stylelint/lib/utils/isStandardSyntaxRule.mjs';
|
|
@@ -92,4 +91,4 @@ export default function selectorAttributeOperatorSpaceChecker (options) {
|
|
|
92
91
|
});
|
|
93
92
|
}
|
|
94
93
|
});
|
|
95
|
-
}
|
|
94
|
+
}
|