linter-bundle 6.2.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.linter-bundle.js +27 -17
- package/.linter-bundle.schema.json +45 -0
- package/CHANGELOG.md +149 -4
- package/README.md +60 -63
- package/eslint/gatsby.mjs +95 -0
- package/eslint/index.mjs +1127 -0
- package/eslint/javascript-lazy.mjs +24 -0
- package/eslint/javascript.mjs +126 -0
- package/eslint/jest.mjs +172 -0
- package/eslint/jsdoc.mjs +103 -0
- package/eslint/react.mjs +232 -0
- package/eslint/rules/no-unnecessary-typeof.md +1 -1
- package/eslint/rules/{no-unnecessary-typeof.js → no-unnecessary-typeof.mjs} +9 -11
- package/eslint/rules/restricted-filenames.md +4 -4
- package/eslint/rules/{restricted-filenames.js → restricted-filenames.mjs} +7 -6
- package/eslint/storybook.mjs +42 -0
- package/eslint/type-declarations.mjs +49 -0
- package/eslint/{overrides-worker.cjs → worker.mjs} +12 -14
- package/eslint.mjs +5 -0
- package/files/index.js +3 -3
- package/helper/{ensure-type.cjs → ensure-type.mjs} +1 -5
- package/helper/get-outdated-dependencies.js +4 -4
- package/helper/get-outdated-overrides.js +2 -2
- package/helper/get-stylelint-path.js +4 -3
- package/helper/is-npm-or-yarn.js +2 -2
- package/helper/linter-bundle-config.d.ts +24 -0
- package/helper/linter-bundle-config.js +9 -14
- package/helper/run-process.js +1 -1
- package/lint.js +21 -16
- package/package.json +31 -29
- package/stylelint/index.mjs +1111 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/html-tags/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/{selectors.cjs → selectors.mjs} +15 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-case/{index.cjs → index.mjs} +6 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-name-space-after/{index.cjs → index.mjs} +11 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-newline-after/{index.cjs → index.mjs} +18 -22
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/at-rule-semicolon-space-before/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{atRuleNameSpaceChecker.cjs → atRuleNameSpaceChecker.mjs} +4 -3
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-empty-line-before/{index.cjs → index.mjs} +16 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-after/{index.cjs → index.mjs} +13 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-newline-before/{index.cjs → index.mjs} +11 -40
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-closing-brace-space-before/{index.cjs → index.mjs} +10 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-newline-after/{index.cjs → index.mjs} +14 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-after/{index.cjs → index.mjs} +13 -30
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/block-opening-brace-space-before/{index.cjs → index.mjs} +14 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/color-hex-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.mjs +93 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-before/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-after/{index.cjs → index.mjs} +11 -29
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-newline-before/{index.cjs → index.mjs} +9 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-after/{index.cjs → index.mjs} +10 -23
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-semicolon-space-before/{index.cjs → index.mjs} +11 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-block-trailing-semicolon/{index.cjs → index.mjs} +9 -27
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-newline-after/{index.cjs → index.mjs} +9 -25
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationBangSpaceChecker.cjs → declarationBangSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{declarationColonSpaceChecker.cjs → declarationColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{findMediaOperator.cjs → findMediaOperator.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-newline-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-max-empty-lines/{index.cjs → index.mjs} +19 -39
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-newline-inside/{index.cjs → index.mjs} +19 -54
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-parentheses-space-inside/{index.cjs → index.mjs} +21 -68
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/function-whitespace-after/{index.cjs → index.mjs} +16 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceChecker.cjs → functionCommaSpaceChecker.mjs} +8 -7
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{functionCommaSpaceFix.cjs → functionCommaSpaceFix.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/indentation/{index.cjs → index.mjs} +39 -64
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/linebreaks/{index.cjs → index.mjs} +15 -44
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-empty-lines/{index.cjs → index.mjs} +10 -49
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/max-line-length/{index.cjs → index.mjs} +10 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-colon-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-name-case/{index.cjs → index.mjs} +9 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-parentheses-space-inside/{index.cjs → index.mjs} +8 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-feature-range-operator-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-after/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/media-query-list-comma-space-before/{index.cjs → index.mjs} +8 -9
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaFeatureColonSpaceChecker.cjs → mediaFeatureColonSpaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{mediaQueryListCommaWhitespaceChecker.cjs → mediaQueryListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-empty-first-line/{index.cjs → index.mjs} +6 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-eol-whitespace/{index.cjs → index.mjs} +13 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-extra-semicolons/{index.cjs → index.mjs} +10 -33
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/no-missing-end-of-source-newline/{index.cjs → index.mjs} +7 -13
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-leading-zero/{index.cjs → index.mjs} +13 -31
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/number-no-trailing-zeros/{index.cjs → index.mjs} +9 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/property-case/{index.cjs → index.mjs} +10 -16
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-brackets-space-inside/{index.cjs → index.mjs} +9 -36
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-attribute-operator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-combinator-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-descendant-combinator-no-non-space/{index.cjs → index.mjs} +9 -20
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-after/{index.cjs → index.mjs} +9 -14
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-newline-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-after/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-list-comma-space-before/{index.cjs → index.mjs} +7 -8
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-max-empty-lines/{index.cjs → index.mjs} +10 -21
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-case/{index.cjs → index.mjs} +10 -24
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-class-parentheses-space-inside/{index.cjs → index.mjs} +12 -35
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/selector-pseudo-element-case/{index.cjs → index.mjs} +10 -15
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorAttributeOperatorSpaceChecker.cjs → selectorAttributeOperatorSpaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorCombinatorSpaceChecker.cjs → selectorCombinatorSpaceChecker.mjs} +12 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{selectorListCommaWhitespaceChecker.cjs → selectorListCommaWhitespaceChecker.mjs} +5 -4
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/string-quotes/{index.cjs → index.mjs} +43 -65
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unicode-bom/{index.cjs → index.mjs} +5 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/unit-case/{index.cjs → index.mjs} +17 -34
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-after/{index.cjs → index.mjs} +11 -12
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-newline-before/{index.cjs → index.mjs} +6 -6
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-after/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-comma-space-before/{index.cjs → index.mjs} +10 -11
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/value-list-max-empty-lines/{index.cjs → index.mjs} +12 -18
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/{valueListCommaWhitespaceChecker.cjs → valueListCommaWhitespaceChecker.mjs} +6 -5
- package/stylelint/plugins/stylelint-15.11.0-stylistic/style-search/{index.cjs → index.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{addEmptyLineAfter.cjs → addEmptyLineAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{hasEmptyBlock.cjs → hasEmptyBlock.mjs} +2 -2
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{nextNonCommentNode.cjs → nextNonCommentNode.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{removeEmptyLinesAfter.cjs → removeEmptyLinesAfter.mjs} +1 -1
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/transformSelector.mjs +19 -0
- package/stylelint/plugins/stylelint-15.11.0-stylistic/utils/{whitespaceChecker.cjs → whitespaceChecker.mjs} +5 -5
- package/stylelint/plugins/stylelint-selector-no-empty.js +2 -0
- package/stylelint/plugins/stylelint-selector-tag-no-without-class.js +2 -2
- package/stylelint.mjs +6 -0
- package/TODO.md +0 -58
- package/eslint/index.cjs +0 -1065
- package/eslint/overrides-gatsby.cjs +0 -108
- package/eslint/overrides-javascript-lazy.cjs +0 -27
- package/eslint/overrides-javascript.cjs +0 -121
- package/eslint/overrides-jest.cjs +0 -144
- package/eslint/overrides-jsdoc.cjs +0 -94
- package/eslint/overrides-react.cjs +0 -220
- package/eslint/overrides-storybook.cjs +0 -44
- package/eslint/overrides-type-declarations.cjs +0 -51
- package/eslint/rules/no-global-undefined-check.js +0 -85
- package/eslint/rules/no-global-undefined-check.md +0 -34
- package/eslint.cjs +0 -5
- package/stylelint/index.cjs +0 -1104
- package/stylelint/plugins/stylelint-15.11.0-stylistic/rules/declaration-bang-space-after/index.cjs +0 -95
- package/stylelint.cjs +0 -5
package/stylelint/plugins/stylelint-15.11.0-stylistic/reference/{selectors.cjs → selectors.mjs}
RENAMED
|
@@ -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
|
-
|
|
4
|
+
import uniteSets from 'stylelint/lib/utils/uniteSets.mjs';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
import htmlTags from '../html-tags/index.mjs';
|
|
7
7
|
|
|
8
8
|
const deprecatedHtmlTypeSelectors = new Set([
|
|
9
9
|
'acronym',
|
|
@@ -35,9 +35,9 @@ const deprecatedHtmlTypeSelectors = new Set([
|
|
|
35
35
|
/** @type {Set<string>} */
|
|
36
36
|
const standardHtmlTypeSelectors = new Set(htmlTags);
|
|
37
37
|
|
|
38
|
-
const htmlTypeSelectors = uniteSets(deprecatedHtmlTypeSelectors, standardHtmlTypeSelectors);
|
|
38
|
+
export const htmlTypeSelectors = uniteSets(deprecatedHtmlTypeSelectors, standardHtmlTypeSelectors);
|
|
39
39
|
|
|
40
|
-
const mixedCaseSvgTypeSelectors = new Set([
|
|
40
|
+
export const mixedCaseSvgTypeSelectors = new Set([
|
|
41
41
|
'altGlyph',
|
|
42
42
|
'altGlyphDef',
|
|
43
43
|
'altGlyphItem',
|
|
@@ -78,11 +78,11 @@ const mixedCaseSvgTypeSelectors = new Set([
|
|
|
78
78
|
]);
|
|
79
79
|
|
|
80
80
|
// These are the ones that can have single-colon notation
|
|
81
|
-
const levelOneAndTwoPseudoElements = new Set(['before', 'after', 'first-line', 'first-letter']);
|
|
81
|
+
export const levelOneAndTwoPseudoElements = new Set(['before', 'after', 'first-line', 'first-letter']);
|
|
82
82
|
|
|
83
|
-
const shadowTreePseudoElements = new Set(['part']);
|
|
83
|
+
export const shadowTreePseudoElements = new Set(['part']);
|
|
84
84
|
|
|
85
|
-
const webkitScrollbarPseudoElements = new Set([
|
|
85
|
+
export const webkitScrollbarPseudoElements = new Set([
|
|
86
86
|
'-webkit-resizer',
|
|
87
87
|
'-webkit-scrollbar',
|
|
88
88
|
'-webkit-scrollbar-button',
|
|
@@ -161,7 +161,7 @@ const vendorSpecificPseudoElements = uniteSets(webkitScrollbarPseudoElements, [
|
|
|
161
161
|
'-webkit-validation-bubble-text-block'
|
|
162
162
|
]);
|
|
163
163
|
|
|
164
|
-
const pseudoElements = uniteSets(
|
|
164
|
+
export const pseudoElements = uniteSets(
|
|
165
165
|
levelOneAndTwoPseudoElements,
|
|
166
166
|
vendorSpecificPseudoElements,
|
|
167
167
|
shadowTreePseudoElements,
|
|
@@ -187,20 +187,20 @@ const pseudoElements = uniteSets(
|
|
|
187
187
|
]
|
|
188
188
|
);
|
|
189
189
|
|
|
190
|
-
const aNPlusBNotationPseudoClasses = new Set([
|
|
190
|
+
export const aNPlusBNotationPseudoClasses = new Set([
|
|
191
191
|
'nth-column',
|
|
192
192
|
'nth-last-column',
|
|
193
193
|
'nth-last-of-type',
|
|
194
194
|
'nth-of-type'
|
|
195
195
|
]);
|
|
196
196
|
|
|
197
|
-
const aNPlusBOfSNotationPseudoClasses = new Set(['nth-child', 'nth-last-child']);
|
|
197
|
+
export const aNPlusBOfSNotationPseudoClasses = new Set(['nth-child', 'nth-last-child']);
|
|
198
198
|
|
|
199
|
-
const atRulePagePseudoClasses = new Set(['first', 'right', 'left', 'blank']);
|
|
199
|
+
export const atRulePagePseudoClasses = new Set(['first', 'right', 'left', 'blank']);
|
|
200
200
|
|
|
201
|
-
const linguisticPseudoClasses = new Set(['dir', 'lang']);
|
|
201
|
+
export const linguisticPseudoClasses = new Set(['dir', 'lang']);
|
|
202
202
|
|
|
203
|
-
const logicalCombinationsPseudoClasses = new Set(['has', 'is', 'matches', 'not', 'where']);
|
|
203
|
+
export const logicalCombinationsPseudoClasses = new Set(['has', 'is', 'matches', 'not', 'where']);
|
|
204
204
|
|
|
205
205
|
const vendorSpecificPseudoClasses = new Set([
|
|
206
206
|
'-khtml-drag',
|
|
@@ -235,7 +235,7 @@ const vendorSpecificPseudoClasses = new Set([
|
|
|
235
235
|
]);
|
|
236
236
|
|
|
237
237
|
// https://webkit.org/blog/363/styling-scrollbars/
|
|
238
|
-
const webkitScrollbarPseudoClasses = new Set([
|
|
238
|
+
export const webkitScrollbarPseudoClasses = new Set([
|
|
239
239
|
'horizontal',
|
|
240
240
|
'vertical',
|
|
241
241
|
'decrement',
|
|
@@ -249,7 +249,7 @@ const webkitScrollbarPseudoClasses = new Set([
|
|
|
249
249
|
'window-inactive'
|
|
250
250
|
]);
|
|
251
251
|
|
|
252
|
-
const pseudoClasses = uniteSets(
|
|
252
|
+
export const pseudoClasses = uniteSets(
|
|
253
253
|
aNPlusBNotationPseudoClasses,
|
|
254
254
|
linguisticPseudoClasses,
|
|
255
255
|
logicalCombinationsPseudoClasses,
|
|
@@ -309,19 +309,3 @@ const pseudoClasses = uniteSets(
|
|
|
309
309
|
'window-inactive' // for ::selection (chrome)
|
|
310
310
|
]
|
|
311
311
|
);
|
|
312
|
-
|
|
313
|
-
module.exports = {
|
|
314
|
-
aNPlusBNotationPseudoClasses,
|
|
315
|
-
aNPlusBOfSNotationPseudoClasses,
|
|
316
|
-
atRulePagePseudoClasses,
|
|
317
|
-
levelOneAndTwoPseudoElements,
|
|
318
|
-
linguisticPseudoClasses,
|
|
319
|
-
logicalCombinationsPseudoClasses,
|
|
320
|
-
mixedCaseSvgTypeSelectors,
|
|
321
|
-
pseudoClasses,
|
|
322
|
-
pseudoElements,
|
|
323
|
-
shadowTreePseudoElements,
|
|
324
|
-
htmlTypeSelectors,
|
|
325
|
-
webkitScrollbarPseudoClasses,
|
|
326
|
-
webkitScrollbarPseudoElements
|
|
327
|
-
};
|
|
@@ -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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import isStandardSyntaxAtRule from 'stylelint/lib/utils/isStandardSyntaxAtRule.mjs';
|
|
6
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
7
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
8
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
9
9
|
|
|
10
10
|
const ruleName = 'plugin/at-rule-name-case';
|
|
11
11
|
|
|
@@ -45,12 +45,6 @@ const rule = (primary, _secondary, context) => (root, result) => {
|
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
if (context.fix) {
|
|
49
|
-
atRule.name = expectedName;
|
|
50
|
-
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
48
|
report({
|
|
55
49
|
message: messages.expected(name, expectedName),
|
|
56
50
|
node: atRule,
|
|
@@ -63,4 +57,4 @@ const rule = (primary, _secondary, context) => (root, result) => {
|
|
|
63
57
|
rule.ruleName = ruleName;
|
|
64
58
|
rule.messages = messages;
|
|
65
59
|
rule.meta = meta;
|
|
66
|
-
|
|
60
|
+
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 atRuleNameSpaceChecker from '../atRuleNameSpaceChecker.mjs';
|
|
10
10
|
|
|
11
11
|
const ruleName = 'plugin/at-rule-name-space-after';
|
|
12
12
|
|
|
@@ -38,13 +38,11 @@ const rule = (primary, _secondary, context) => {
|
|
|
38
38
|
result,
|
|
39
39
|
locationChecker: checker.after,
|
|
40
40
|
checkedRuleName: ruleName,
|
|
41
|
-
fix:
|
|
42
|
-
(atRule)
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
: null
|
|
41
|
+
fix: (atRule) => {
|
|
42
|
+
if (typeof atRule.raws.afterName === 'string') {
|
|
43
|
+
atRule.raws.afterName = atRule.raws.afterName.replace(/^\s*/, ' ');
|
|
44
|
+
}
|
|
45
|
+
}
|
|
48
46
|
});
|
|
49
47
|
};
|
|
50
48
|
};
|
|
@@ -52,4 +50,4 @@ const rule = (primary, _secondary, context) => {
|
|
|
52
50
|
rule.ruleName = ruleName;
|
|
53
51
|
rule.messages = messages;
|
|
54
52
|
rule.meta = meta;
|
|
55
|
-
|
|
53
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,16 +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
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import hasBlock from 'stylelint/lib/utils/hasBlock.mjs';
|
|
6
|
+
import isStandardSyntaxAtRule from 'stylelint/lib/utils/isStandardSyntaxAtRule.mjs';
|
|
7
|
+
import rawNodeString from 'stylelint/lib/utils/rawNodeString.mjs';
|
|
8
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
9
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
10
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
import nextNonCommentNode from '../../utils/nextNonCommentNode.mjs';
|
|
13
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
14
14
|
|
|
15
15
|
const ruleName = 'plugin/at-rule-semicolon-newline-after';
|
|
16
16
|
|
|
@@ -63,18 +63,14 @@ const rule = (primary, _secondary, context) => {
|
|
|
63
63
|
source: rawNodeString(nodeToCheck),
|
|
64
64
|
index: -1,
|
|
65
65
|
err: (message) => {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
result,
|
|
75
|
-
ruleName
|
|
76
|
-
});
|
|
77
|
-
}
|
|
66
|
+
report({
|
|
67
|
+
message,
|
|
68
|
+
node: atRule,
|
|
69
|
+
index: atRule.toString().length + 1,
|
|
70
|
+
endIndex: atRule.toString().length + 1,
|
|
71
|
+
result,
|
|
72
|
+
ruleName
|
|
73
|
+
});
|
|
78
74
|
}
|
|
79
75
|
});
|
|
80
76
|
});
|
|
@@ -84,4 +80,4 @@ const rule = (primary, _secondary, context) => {
|
|
|
84
80
|
rule.ruleName = ruleName;
|
|
85
81
|
rule.messages = messages;
|
|
86
82
|
rule.meta = meta;
|
|
87
|
-
|
|
83
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import hasBlock from 'stylelint/lib/utils/hasBlock.mjs';
|
|
6
|
+
import isStandardSyntaxAtRule from 'stylelint/lib/utils/isStandardSyntaxAtRule.mjs';
|
|
7
|
+
import rawNodeString from 'stylelint/lib/utils/rawNodeString.mjs';
|
|
8
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
9
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
10
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
13
13
|
|
|
14
14
|
const ruleName = 'plugin/at-rule-semicolon-space-before';
|
|
15
15
|
|
|
@@ -55,6 +55,7 @@ const rule = (primary) => {
|
|
|
55
55
|
message: m,
|
|
56
56
|
node: atRule,
|
|
57
57
|
index: nodeString.length - 1,
|
|
58
|
+
endIndex: nodeString.length - 1,
|
|
58
59
|
result,
|
|
59
60
|
ruleName
|
|
60
61
|
});
|
|
@@ -67,4 +68,4 @@ const rule = (primary) => {
|
|
|
67
68
|
rule.ruleName = ruleName;
|
|
68
69
|
rule.messages = messages;
|
|
69
70
|
rule.meta = meta;
|
|
70
|
-
|
|
71
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,8 +1,8 @@
|
|
|
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 isStandardSyntaxAtRule from 'stylelint/lib/utils/isStandardSyntaxAtRule.mjs';
|
|
5
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @param {{
|
|
@@ -13,7 +13,7 @@ const report = require('stylelint/lib/utils/report.cjs');
|
|
|
13
13
|
* fix?: ((atRule: import('postcss').AtRule) => void) | null,
|
|
14
14
|
* }} options
|
|
15
15
|
*/
|
|
16
|
-
|
|
16
|
+
export default function atRuleNameSpaceChecker (options) {
|
|
17
17
|
options.root.walkAtRules((atRule) => {
|
|
18
18
|
if (!isStandardSyntaxAtRule(atRule)) {
|
|
19
19
|
return;
|
|
@@ -46,6 +46,7 @@ module.exports = function atRuleNameSpaceChecker (options) {
|
|
|
46
46
|
message: m,
|
|
47
47
|
node,
|
|
48
48
|
index,
|
|
49
|
+
endIndex: index,
|
|
49
50
|
result: options.result,
|
|
50
51
|
ruleName: options.checkedRuleName
|
|
51
52
|
});
|
|
@@ -1,19 +1,19 @@
|
|
|
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
|
-
|
|
15
|
-
|
|
16
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import blockString from 'stylelint/lib/utils/blockString.mjs';
|
|
6
|
+
import hasBlock from 'stylelint/lib/utils/hasBlock.mjs';
|
|
7
|
+
import hasEmptyLine from 'stylelint/lib/utils/hasEmptyLine.mjs';
|
|
8
|
+
import isSingleLineString from 'stylelint/lib/utils/isSingleLineString.mjs';
|
|
9
|
+
import optionsMatches from 'stylelint/lib/utils/optionsMatches.mjs';
|
|
10
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
11
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
12
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
13
|
+
|
|
14
|
+
import addEmptyLineAfter from '../../utils/addEmptyLineAfter.mjs';
|
|
15
|
+
import hasEmptyBlock from '../../utils/hasEmptyBlock.mjs';
|
|
16
|
+
import removeEmptyLinesAfter from '../../utils/removeEmptyLinesAfter.mjs';
|
|
17
17
|
|
|
18
18
|
const ruleName = 'plugin/block-closing-brace-empty-line-before';
|
|
19
19
|
|
|
@@ -97,21 +97,6 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
97
97
|
return;
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
-
if (context.fix) {
|
|
101
|
-
const { newline } = context;
|
|
102
|
-
|
|
103
|
-
if (typeof newline !== 'string') { return; }
|
|
104
|
-
|
|
105
|
-
if (expectEmptyLineBefore) {
|
|
106
|
-
addEmptyLineAfter(statement, newline);
|
|
107
|
-
}
|
|
108
|
-
else {
|
|
109
|
-
removeEmptyLinesAfter(statement, newline);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
100
|
const message = expectEmptyLineBefore ? messages.expected : messages.rejected;
|
|
116
101
|
|
|
117
102
|
report({
|
|
@@ -119,7 +104,8 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
119
104
|
result,
|
|
120
105
|
ruleName,
|
|
121
106
|
node: statement,
|
|
122
|
-
index
|
|
107
|
+
index,
|
|
108
|
+
endIndex: index
|
|
123
109
|
});
|
|
124
110
|
}
|
|
125
111
|
};
|
|
@@ -127,4 +113,4 @@ const rule = (primary, secondaryOptions, context) => (root, result) => {
|
|
|
127
113
|
rule.ruleName = ruleName;
|
|
128
114
|
rule.messages = messages;
|
|
129
115
|
rule.meta = meta;
|
|
130
|
-
|
|
116
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,17 +1,17 @@
|
|
|
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
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import blockString from 'stylelint/lib/utils/blockString.mjs';
|
|
6
|
+
import hasBlock from 'stylelint/lib/utils/hasBlock.mjs';
|
|
7
|
+
import optionsMatches from 'stylelint/lib/utils/optionsMatches.mjs';
|
|
8
|
+
import rawNodeString from 'stylelint/lib/utils/rawNodeString.mjs';
|
|
9
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
10
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
11
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
12
|
+
import { isString } from 'stylelint/lib/utils/validateTypes.mjs';
|
|
13
|
+
|
|
14
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
15
15
|
|
|
16
16
|
const ruleName = 'plugin/block-closing-brace-newline-after';
|
|
17
17
|
|
|
@@ -112,33 +112,11 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
112
112
|
index: -1,
|
|
113
113
|
lineCheckStr: blockString(statement),
|
|
114
114
|
err: (message) => {
|
|
115
|
-
if (context.fix) {
|
|
116
|
-
const nodeToCheckRaws = nodeToCheck.raws;
|
|
117
|
-
|
|
118
|
-
if (typeof nodeToCheckRaws.before !== 'string') { return; }
|
|
119
|
-
|
|
120
|
-
if (primary.startsWith('always')) {
|
|
121
|
-
const index = nodeToCheckRaws.before.search(/\r?\n/);
|
|
122
|
-
|
|
123
|
-
nodeToCheckRaws.before =
|
|
124
|
-
index >= 0 ?
|
|
125
|
-
nodeToCheckRaws.before.slice(index)
|
|
126
|
-
: context.newline + nodeToCheckRaws.before;
|
|
127
|
-
|
|
128
|
-
return;
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
if (primary.startsWith('never')) {
|
|
132
|
-
nodeToCheckRaws.before = '';
|
|
133
|
-
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
115
|
report({
|
|
139
116
|
message,
|
|
140
117
|
node: statement,
|
|
141
118
|
index: reportIndex,
|
|
119
|
+
endIndex: reportIndex,
|
|
142
120
|
result,
|
|
143
121
|
ruleName
|
|
144
122
|
});
|
|
@@ -151,4 +129,4 @@ const rule = (primary, secondaryOptions, context) => {
|
|
|
151
129
|
rule.ruleName = ruleName;
|
|
152
130
|
rule.messages = messages;
|
|
153
131
|
rule.meta = meta;
|
|
154
|
-
|
|
132
|
+
export default stylelint.createPlugin(ruleName, rule);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/* eslint-disable -- We want to keep as much of the original code as possible */
|
|
2
2
|
// @ts-nocheck
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
import stylelint from 'stylelint';
|
|
5
|
+
import blockString from 'stylelint/lib/utils/blockString.mjs';
|
|
6
|
+
import hasBlock from 'stylelint/lib/utils/hasBlock.mjs';
|
|
7
|
+
import isSingleLineString from 'stylelint/lib/utils/isSingleLineString.mjs';
|
|
8
|
+
import report from 'stylelint/lib/utils/report.mjs';
|
|
9
|
+
import ruleMessages from 'stylelint/lib/utils/ruleMessages.mjs';
|
|
10
|
+
import validateOptions from 'stylelint/lib/utils/validateOptions.mjs';
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
import hasEmptyBlock from '../../utils/hasEmptyBlock.mjs';
|
|
13
13
|
|
|
14
14
|
const ruleName = 'plugin/block-closing-brace-newline-before';
|
|
15
15
|
|
|
@@ -86,42 +86,13 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
86
86
|
* @param {string} message
|
|
87
87
|
*/
|
|
88
88
|
function complain (message) {
|
|
89
|
-
if (context.fix) {
|
|
90
|
-
const statementRaws = statement.raws;
|
|
91
|
-
|
|
92
|
-
if (typeof statementRaws.after !== 'string') { return; }
|
|
93
|
-
|
|
94
|
-
if (primary.startsWith('always')) {
|
|
95
|
-
const firstWhitespaceIndex = statementRaws.after.search(/\s/);
|
|
96
|
-
const newlineBefore =
|
|
97
|
-
firstWhitespaceIndex >= 0 ?
|
|
98
|
-
statementRaws.after.slice(0, firstWhitespaceIndex)
|
|
99
|
-
: statementRaws.after;
|
|
100
|
-
const newlineAfter =
|
|
101
|
-
firstWhitespaceIndex >= 0 ? statementRaws.after.slice(firstWhitespaceIndex) : '';
|
|
102
|
-
const newlineIndex = newlineAfter.search(/\r?\n/);
|
|
103
|
-
|
|
104
|
-
statementRaws.after =
|
|
105
|
-
newlineIndex >= 0 ?
|
|
106
|
-
newlineBefore + newlineAfter.slice(newlineIndex)
|
|
107
|
-
: newlineBefore + context.newline + newlineAfter;
|
|
108
|
-
|
|
109
|
-
return;
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
if (primary === 'never-multi-line') {
|
|
113
|
-
statementRaws.after = statementRaws.after.replace(/\s/g, '');
|
|
114
|
-
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
89
|
report({
|
|
120
90
|
message,
|
|
121
91
|
result,
|
|
122
92
|
ruleName,
|
|
123
93
|
node: statement,
|
|
124
|
-
index
|
|
94
|
+
index,
|
|
95
|
+
endIndex: index,
|
|
125
96
|
});
|
|
126
97
|
}
|
|
127
98
|
}
|
|
@@ -130,4 +101,4 @@ const rule = (primary, _secondaryOptions, context) => (root, result) => {
|
|
|
130
101
|
rule.ruleName = ruleName;
|
|
131
102
|
rule.messages = messages;
|
|
132
103
|
rule.meta = meta;
|
|
133
|
-
|
|
104
|
+
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 blockString from 'stylelint/lib/utils/blockString.mjs';
|
|
6
|
+
import hasBlock from 'stylelint/lib/utils/hasBlock.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
|
-
|
|
12
|
-
|
|
11
|
+
import hasEmptyBlock from '../../utils/hasEmptyBlock.mjs';
|
|
12
|
+
import whitespaceChecker from '../../utils/whitespaceChecker.mjs';
|
|
13
13
|
|
|
14
14
|
const ruleName = 'plugin/block-closing-brace-space-before';
|
|
15
15
|
|
|
@@ -74,28 +74,11 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
74
74
|
source,
|
|
75
75
|
index: source.length - 1,
|
|
76
76
|
err: (message) => {
|
|
77
|
-
if (context.fix) {
|
|
78
|
-
const statementRaws = statement.raws;
|
|
79
|
-
|
|
80
|
-
if (typeof statementRaws.after !== 'string') { return; }
|
|
81
|
-
|
|
82
|
-
if (primary.startsWith('always')) {
|
|
83
|
-
statementRaws.after = statementRaws.after.replace(/\s*$/, ' ');
|
|
84
|
-
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
if (primary.startsWith('never')) {
|
|
89
|
-
statementRaws.after = statementRaws.after.replace(/\s*$/, '');
|
|
90
|
-
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
|
|
95
77
|
report({
|
|
96
78
|
message,
|
|
97
79
|
node: statement,
|
|
98
80
|
index,
|
|
81
|
+
endIndex: index,
|
|
99
82
|
result,
|
|
100
83
|
ruleName
|
|
101
84
|
});
|
|
@@ -108,4 +91,4 @@ const rule = (primary, _secondaryOptions, context) => {
|
|
|
108
91
|
rule.ruleName = ruleName;
|
|
109
92
|
rule.messages = messages;
|
|
110
93
|
rule.meta = meta;
|
|
111
|
-
|
|
94
|
+
export default stylelint.createPlugin(ruleName, rule);
|