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
|
@@ -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 hasBlock from 'stylelint/lib/utils/hasBlock.mjs';
|
|
6
|
+
import optionsMatches from 'stylelint/lib/utils/optionsMatches.mjs';
|
|
7
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
8
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
9
|
+
import { isAtRule } from 'stylelint/lib/utils/typeGuards.mjs';
|
|
10
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/declaration-block-trailing-semicolon';
|
|
13
13
|
|
|
@@ -99,18 +99,6 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
// auto-fix
|
|
103
|
-
if (context.fix) {
|
|
104
|
-
node.parent.raws.semicolon = true;
|
|
105
|
-
|
|
106
|
-
if (isAtRule(node)) {
|
|
107
|
-
node.raws.between = '';
|
|
108
|
-
node.parent.raws.after = ' ';
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
|
|
114
102
|
message = messages.expected;
|
|
115
103
|
}
|
|
116
104
|
else if (primary === 'never') {
|
|
@@ -118,13 +106,6 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
118
106
|
return;
|
|
119
107
|
}
|
|
120
108
|
|
|
121
|
-
// auto-fix
|
|
122
|
-
if (context.fix) {
|
|
123
|
-
node.parent.raws.semicolon = false;
|
|
124
|
-
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
|
|
128
109
|
message = messages.rejected;
|
|
129
110
|
}
|
|
130
111
|
else {
|
|
@@ -135,6 +116,7 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
135
116
|
message,
|
|
136
117
|
node,
|
|
137
118
|
index: node.toString().trim().length - 1,
|
|
119
|
+
endIndex: node.toString().trim().length - 1,
|
|
138
120
|
result,
|
|
139
121
|
ruleName
|
|
140
122
|
});
|
|
@@ -144,4 +126,4 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
144
126
|
rule.ruleName = ruleName;
|
|
145
127
|
rule.messages = messages;
|
|
146
128
|
rule.meta = meta;
|
|
147
|
-
|
|
129
|
+
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
|
-
|
|
9
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import { declarationValueIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
6
|
+
import isStandardSyntaxDeclaration from 'stylelint/lib/utils/isStandardSyntaxDeclaration.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
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
12
12
|
|
|
13
13
|
const ruleName = 'plugin/declaration-colon-newline-after';
|
|
14
14
|
|
|
@@ -62,27 +62,11 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
62
62
|
index: indexToCheck,
|
|
63
63
|
lineCheckStr: decl.value,
|
|
64
64
|
err: (m) => {
|
|
65
|
-
if (context.fix) {
|
|
66
|
-
const between = decl.raws.between;
|
|
67
|
-
|
|
68
|
-
if (between == null) { throw new Error('`between` must be present'); }
|
|
69
|
-
|
|
70
|
-
const betweenStart = declarationValueIndex(decl) - between.length;
|
|
71
|
-
const sliceIndex = indexToCheck - betweenStart + 1;
|
|
72
|
-
const betweenBefore = between.slice(0, sliceIndex);
|
|
73
|
-
const betweenAfter = between.slice(sliceIndex);
|
|
74
|
-
|
|
75
|
-
decl.raws.between = (/^\s*\n/).test(betweenAfter) ?
|
|
76
|
-
betweenBefore + betweenAfter.replace(/^[^\S\n\r]*/, '')
|
|
77
|
-
: betweenBefore + context.newline + betweenAfter;
|
|
78
|
-
|
|
79
|
-
return;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
65
|
report({
|
|
83
66
|
message: m,
|
|
84
67
|
node: decl,
|
|
85
68
|
index: indexToCheck,
|
|
69
|
+
endIndex: indexToCheck,
|
|
86
70
|
result,
|
|
87
71
|
ruleName
|
|
88
72
|
});
|
|
@@ -96,4 +80,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
96
80
|
rule.ruleName = ruleName;
|
|
97
81
|
rule.messages = messages;
|
|
98
82
|
rule.meta = meta;
|
|
99
|
-
|
|
83
|
+
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 { declarationValueIndex } 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 declarationColonSpaceChecker from '../declarationColonSpaceChecker.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/declaration-colon-space-after';
|
|
13
13
|
|
|
@@ -41,7 +41,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
41
41
|
result,
|
|
42
42
|
locationChecker: checker.after,
|
|
43
43
|
checkedRuleName: ruleName,
|
|
44
|
-
fix:
|
|
44
|
+
fix:
|
|
45
45
|
(decl, index) => {
|
|
46
46
|
const colonIndex = index - declarationValueIndex(decl);
|
|
47
47
|
const between = decl.raws.between;
|
|
@@ -64,7 +64,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
64
64
|
|
|
65
65
|
return false;
|
|
66
66
|
}
|
|
67
|
-
: null
|
|
68
67
|
});
|
|
69
68
|
};
|
|
70
69
|
};
|
|
@@ -72,4 +71,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
72
71
|
rule.ruleName = ruleName;
|
|
73
72
|
rule.messages = messages;
|
|
74
73
|
rule.meta = meta;
|
|
75
|
-
|
|
74
|
+
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 { declarationValueIndex } 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 declarationColonSpaceChecker from '../declarationColonSpaceChecker.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/declaration-colon-space-before';
|
|
13
13
|
|
|
@@ -40,7 +40,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
40
40
|
result,
|
|
41
41
|
locationChecker: checker.before,
|
|
42
42
|
checkedRuleName: ruleName,
|
|
43
|
-
fix:
|
|
43
|
+
fix:
|
|
44
44
|
(decl, index) => {
|
|
45
45
|
const colonIndex = index - declarationValueIndex(decl);
|
|
46
46
|
const between = decl.raws.between;
|
|
@@ -63,7 +63,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
63
63
|
|
|
64
64
|
return false;
|
|
65
65
|
}
|
|
66
|
-
: null
|
|
67
66
|
});
|
|
68
67
|
};
|
|
69
68
|
};
|
|
@@ -71,4 +70,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
71
70
|
rule.ruleName = ruleName;
|
|
72
71
|
rule.messages = messages;
|
|
73
72
|
rule.meta = meta;
|
|
74
|
-
|
|
73
|
+
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 { declarationValueIndex } 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
|
/** @typedef {import('postcss').Declaration} Declaration */
|
|
10
10
|
|
|
@@ -21,7 +21,7 @@ const styleSearch = require('../style-search/index.cjs');
|
|
|
21
21
|
* @param options
|
|
22
22
|
* @returns {void}
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
export default function declarationBangSpaceChecker (options) {
|
|
25
25
|
options.root.walkDecls((decl) => {
|
|
26
26
|
const indexOffset = declarationValueIndex(decl);
|
|
27
27
|
const declString = decl.toString();
|
|
@@ -54,6 +54,7 @@ module.exports = function declarationBangSpaceChecker (options) {
|
|
|
54
54
|
message,
|
|
55
55
|
node: decl,
|
|
56
56
|
index,
|
|
57
|
+
endIndex: index,
|
|
57
58
|
result: options.result,
|
|
58
59
|
ruleName: options.checkedRuleName
|
|
59
60
|
});
|
|
@@ -1,9 +1,9 @@
|
|
|
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 { declarationValueIndex } from 'stylelint/lib/utils/nodeFieldIndices.mjs';
|
|
5
|
+
import isStandardSyntaxDeclaration from 'stylelint/lib/utils/isStandardSyntaxDeclaration.mjs';
|
|
6
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
7
7
|
|
|
8
8
|
/** @typedef {(args: { source: string, index: number, lineCheckStr: string, err: (message: string) => void }) => void} LocationChecker */
|
|
9
9
|
|
|
@@ -16,7 +16,7 @@ const report = require('stylelint/lib/utils/report.cjs');
|
|
|
16
16
|
* checkedRuleName: string,
|
|
17
17
|
* }} opts
|
|
18
18
|
*/
|
|
19
|
-
|
|
19
|
+
export default function declarationColonSpaceChecker(opts) {
|
|
20
20
|
opts.root.walkDecls((decl) => {
|
|
21
21
|
if (!isStandardSyntaxDeclaration(decl)) {
|
|
22
22
|
return;
|
|
@@ -47,6 +47,7 @@ module.exports = function declarationColonSpaceChecker(opts) {
|
|
|
47
47
|
message,
|
|
48
48
|
node: decl,
|
|
49
49
|
index: decl.prop.toString().length + 1,
|
|
50
|
+
endIndex: index,
|
|
50
51
|
result: opts.result,
|
|
51
52
|
ruleName: opts.checkedRuleName,
|
|
52
53
|
});
|
|
@@ -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 styleSearch from '../style-search/index.mjs';
|
|
5
5
|
|
|
6
6
|
const rangeOperators = ['>=', '<=', '>', '<', '='];
|
|
7
7
|
|
|
@@ -13,7 +13,7 @@ const rangeOperators = ['>=', '<=', '>', '<', '='];
|
|
|
13
13
|
* @param callback
|
|
14
14
|
* @param {(match: StyleSearchMatch, params: string, atRule: T) => void} cb
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
export default function findMediaOperator (atRule, callback) {
|
|
17
17
|
if (atRule.name.toLowerCase() !== 'media') {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
@@ -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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
8
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
9
|
+
import functionCommaSpaceChecker from '../functionCommaSpaceChecker.mjs';
|
|
10
|
+
import fixer from '../functionCommaSpaceFix.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/function-comma-newline-after';
|
|
13
13
|
|
|
@@ -41,7 +41,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
41
41
|
result,
|
|
42
42
|
locationChecker: checker.afterOneOnly,
|
|
43
43
|
checkedRuleName: ruleName,
|
|
44
|
-
fix:
|
|
44
|
+
fix:
|
|
45
45
|
(div, index, nodes) => fixer({
|
|
46
46
|
div,
|
|
47
47
|
index,
|
|
@@ -50,7 +50,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
50
50
|
position: 'after',
|
|
51
51
|
symb: context.newline || ''
|
|
52
52
|
})
|
|
53
|
-
: null
|
|
54
53
|
});
|
|
55
54
|
};
|
|
56
55
|
};
|
|
@@ -58,4 +57,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
58
57
|
rule.ruleName = ruleName;
|
|
59
58
|
rule.messages = messages;
|
|
60
59
|
rule.meta = meta;
|
|
61
|
-
|
|
60
|
+
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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
8
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
9
|
+
import functionCommaSpaceChecker from '../functionCommaSpaceChecker.mjs';
|
|
10
|
+
import fixer from '../functionCommaSpaceFix.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/function-comma-newline-before';
|
|
13
13
|
|
|
@@ -41,7 +41,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
41
41
|
result,
|
|
42
42
|
locationChecker: checker.beforeAllowingIndentation,
|
|
43
43
|
checkedRuleName: ruleName,
|
|
44
|
-
fix:
|
|
44
|
+
fix:
|
|
45
45
|
(div, index, nodes) => fixer({
|
|
46
46
|
div,
|
|
47
47
|
index,
|
|
@@ -50,7 +50,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
50
50
|
position: 'before',
|
|
51
51
|
symb: context.newline || ''
|
|
52
52
|
})
|
|
53
|
-
: null
|
|
54
53
|
});
|
|
55
54
|
};
|
|
56
55
|
};
|
|
@@ -58,4 +57,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
58
57
|
rule.ruleName = ruleName;
|
|
59
58
|
rule.messages = messages;
|
|
60
59
|
rule.meta = meta;
|
|
61
|
-
|
|
60
|
+
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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
8
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
9
|
+
import functionCommaSpaceChecker from '../functionCommaSpaceChecker.mjs';
|
|
10
|
+
import fixer from '../functionCommaSpaceFix.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/function-comma-space-after';
|
|
13
13
|
|
|
@@ -42,7 +42,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
42
42
|
result,
|
|
43
43
|
locationChecker: checker.after,
|
|
44
44
|
checkedRuleName: ruleName,
|
|
45
|
-
fix:
|
|
45
|
+
fix:
|
|
46
46
|
(div, index, nodes) => fixer({
|
|
47
47
|
div,
|
|
48
48
|
index,
|
|
@@ -51,7 +51,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
51
51
|
position: 'after',
|
|
52
52
|
symb: ' '
|
|
53
53
|
})
|
|
54
|
-
: null
|
|
55
54
|
});
|
|
56
55
|
};
|
|
57
56
|
};
|
|
@@ -59,4 +58,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
59
58
|
rule.ruleName = ruleName;
|
|
60
59
|
rule.messages = messages;
|
|
61
60
|
rule.meta = meta;
|
|
62
|
-
|
|
61
|
+
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
|
-
|
|
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
|
-
|
|
10
|
-
|
|
8
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
9
|
+
import functionCommaSpaceChecker from '../functionCommaSpaceChecker.mjs';
|
|
10
|
+
import fixer from '../functionCommaSpaceFix.mjs';
|
|
11
11
|
|
|
12
12
|
const ruleName = 'plugin/function-comma-space-before';
|
|
13
13
|
|
|
@@ -42,7 +42,7 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
42
42
|
result,
|
|
43
43
|
locationChecker: checker.before,
|
|
44
44
|
checkedRuleName: ruleName,
|
|
45
|
-
fix:
|
|
45
|
+
fix:
|
|
46
46
|
(div, index, nodes) => fixer({
|
|
47
47
|
div,
|
|
48
48
|
index,
|
|
@@ -51,7 +51,6 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
51
51
|
position: 'before',
|
|
52
52
|
symb: ' '
|
|
53
53
|
})
|
|
54
|
-
: null
|
|
55
54
|
});
|
|
56
55
|
};
|
|
57
56
|
};
|
|
@@ -59,4 +58,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
59
58
|
rule.ruleName = ruleName;
|
|
60
59
|
rule.messages = messages;
|
|
61
60
|
rule.meta = meta;
|
|
62
|
-
|
|
61
|
+
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
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
import valueParser from 'postcss-value-parser';
|
|
5
|
+
import stylelint from 'stylelint';
|
|
6
|
+
import getDeclarationValue from 'stylelint/lib/utils/getDeclarationValue.mjs';
|
|
7
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
8
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
9
|
+
import setDeclarationValue from 'stylelint/lib/utils/setDeclarationValue.mjs';
|
|
10
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
11
|
+
import{ isNumber } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
12
12
|
|
|
13
13
|
const ruleName = 'plugin/function-max-empty-lines';
|
|
14
14
|
|
|
@@ -46,8 +46,8 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
46
46
|
|
|
47
47
|
const violatedCRLFNewLinesRegex = new RegExp(`(?:\r\n){${maxAdjacentNewlines + 1},}`);
|
|
48
48
|
const violatedLFNewLinesRegex = new RegExp(`\n{${maxAdjacentNewlines + 1},}`);
|
|
49
|
-
const allowedLFNewLinesString =
|
|
50
|
-
const allowedCRLFNewLinesString =
|
|
49
|
+
const allowedLFNewLinesString = '';
|
|
50
|
+
const allowedCRLFNewLinesString = '';
|
|
51
51
|
|
|
52
52
|
root.walkDecls((decl) => {
|
|
53
53
|
if (!decl.value.includes('(')) {
|
|
@@ -76,35 +76,15 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
]);
|
|
88
|
-
sourceIndexStart = node.sourceIndex + stringifiedNode.length;
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
report({
|
|
92
|
-
message: messages.expected(primary),
|
|
93
|
-
node: decl,
|
|
94
|
-
index: placeIndexOnValueStart(decl) + node.sourceIndex,
|
|
95
|
-
result,
|
|
96
|
-
ruleName
|
|
97
|
-
});
|
|
98
|
-
}
|
|
79
|
+
report({
|
|
80
|
+
message: messages.expected(primary),
|
|
81
|
+
node: decl,
|
|
82
|
+
index: placeIndexOnValueStart(decl) + node.sourceIndex,
|
|
83
|
+
endIndex: placeIndexOnValueStart(decl) + node.sourceIndex,
|
|
84
|
+
result,
|
|
85
|
+
ruleName
|
|
86
|
+
});
|
|
99
87
|
});
|
|
100
|
-
|
|
101
|
-
if (context.fix && splittedValue.length > 0) {
|
|
102
|
-
const updatedValue =
|
|
103
|
-
splittedValue.reduce((accumulator, current) => accumulator + current[0] + current[1], '') +
|
|
104
|
-
stringValue.slice(sourceIndexStart);
|
|
105
|
-
|
|
106
|
-
setDeclarationValue(decl, updatedValue);
|
|
107
|
-
}
|
|
108
88
|
});
|
|
109
89
|
};
|
|
110
90
|
};
|
|
@@ -112,4 +92,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
112
92
|
rule.ruleName = ruleName;
|
|
113
93
|
rule.messages = messages;
|
|
114
94
|
rule.meta = meta;
|
|
115
|
-
|
|
95
|
+
export default stylelint.createPlugin(ruleName, rule);
|