diff --git a/lib/__tests__/standalone-syntax.test.js b/lib/__tests__/standalone-syntax.test.js index 431e2367e9..eac9d8e6b9 100644 --- a/lib/__tests__/standalone-syntax.test.js +++ b/lib/__tests__/standalone-syntax.test.js @@ -20,7 +20,7 @@ it('standalone with postcss-safe-parser', () => { expect(results).toHaveLength(6); - const safeParserExtensionsTest = /\.(css|pcss|postcss)$/i; + const safeParserExtensionsTest = /\.(?:css|pcss|postcss)$/i; results .filter((result) => !safeParserExtensionsTest.test(result.source)) diff --git a/lib/rules/color-hex-alpha/index.js b/lib/rules/color-hex-alpha/index.js index 5c04e62ade..b8dd8c0098 100644 --- a/lib/rules/color-hex-alpha/index.js +++ b/lib/rules/color-hex-alpha/index.js @@ -13,7 +13,7 @@ const messages = ruleMessages(ruleName, { unexpected: (hex) => `Unexpected alpha channel in "${hex}"`, }); -const HEX = /^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i; +const HEX = /^#(?:[\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i; /** @type {import('stylelint').StylelintRule} */ const rule = (primary) => { diff --git a/lib/rules/declaration-colon-newline-after/index.js b/lib/rules/declaration-colon-newline-after/index.js index b5c00f1435..a7e555b63b 100644 --- a/lib/rules/declaration-colon-newline-after/index.js +++ b/lib/rules/declaration-colon-newline-after/index.js @@ -64,7 +64,7 @@ const rule = (primary, _secondaryOptions, context) => { const betweenBefore = between.slice(0, sliceIndex); const betweenAfter = between.slice(sliceIndex); - if (/^\s*\r?\n/.test(betweenAfter)) { + if (/^\s*\n/.test(betweenAfter)) { decl.raws.between = betweenBefore + betweenAfter.replace(/^[^\S\r\n]*/, ''); } else { decl.raws.between = betweenBefore + context.newline + betweenAfter; diff --git a/lib/rules/font-family-name-quotes/index.js b/lib/rules/font-family-name-quotes/index.js index a66fc8906c..fd4bf72100 100644 --- a/lib/rules/font-family-name-quotes/index.js +++ b/lib/rules/font-family-name-quotes/index.js @@ -52,7 +52,7 @@ function quotesRecommended(family) { */ function quotesRequired(family) { return family.split(/\s+/).some((word) => { - return /^(-?\d|--)/.test(word) || !/^[-_a-zA-Z0-9\u{00A0}-\u{10FFFF}]+$/u.test(word); + return /^(?:-?\d|--)/.test(word) || !/^[-\w\u{00A0}-\u{10FFFF}]+$/u.test(word); }); } diff --git a/lib/rules/function-calc-no-unspaced-operator/index.js b/lib/rules/function-calc-no-unspaced-operator/index.js index 92fffc07a7..100026d998 100644 --- a/lib/rules/function-calc-no-unspaced-operator/index.js +++ b/lib/rules/function-calc-no-unspaced-operator/index.js @@ -241,7 +241,7 @@ function insertCharAtIndex(str, index, char) { * @param {string} source */ function blurVariables(source) { - return source.replace(/[$@][^)\s]+|#{.+?}/g, '0'); + return source.replace(/[$@][^)\s]+|#\{.+?\}/g, '0'); } /** diff --git a/lib/rules/indentation/index.js b/lib/rules/indentation/index.js index eccabb75fd..4e703bbf3a 100644 --- a/lib/rules/indentation/index.js +++ b/lib/rules/indentation/index.js @@ -303,13 +303,13 @@ const rule = (primary, secondaryOptions = {}, context) => { parentheticalDepth += 1; } - const followsOpeningBrace = /{[ \t]*$/.test(source.slice(0, newlineIndex)); + const followsOpeningBrace = /\{[ \t]*$/.test(source.slice(0, newlineIndex)); if (followsOpeningBrace) { parentheticalDepth += 1; } - const startingClosingBrace = /^[ \t]*}/.test(source.slice(match.startIndex + 1)); + const startingClosingBrace = /^[ \t]*\}/.test(source.slice(match.startIndex + 1)); if (startingClosingBrace) { parentheticalDepth -= 1; @@ -607,8 +607,10 @@ function inferRootIndentLevel(root, baseIndentLevel, indentSize) { let source = root.source.input.css; source = source.replace(/^[^\r\n]+/, (firstLine) => { - if (/(?:^|\n)([ \t]*)$/.test(root.raws.beforeStart)) { - return RegExp.$1 + firstLine; + const match = /(?:^|\n)([ \t]*)$/.exec(root.raws.beforeStart); + + if (match) { + return match[1] + firstLine; } return ''; diff --git a/lib/rules/max-empty-lines/index.js b/lib/rules/max-empty-lines/index.js index 3a333a3629..678a39b488 100644 --- a/lib/rules/max-empty-lines/index.js +++ b/lib/rules/max-empty-lines/index.js @@ -161,7 +161,7 @@ const rule = (primary, secondaryOptions, context) => { const emptyLFLines = '\n'.repeat(repeatTimes); const emptyCRLFLines = '\r\n'.repeat(repeatTimes); - return /(\r\n)+/g.test(str) + return /(?:\r\n)+/.test(str) ? str.replace(/(\r\n)+/g, ($1) => { if ($1.length / 2 > repeatTimes) { return emptyCRLFLines; diff --git a/lib/rules/media-query-list-comma-newline-after/index.js b/lib/rules/media-query-list-comma-newline-after/index.js index 6ed1e110be..2ef965529c 100644 --- a/lib/rules/media-query-list-comma-newline-after/index.js +++ b/lib/rules/media-query-list-comma-newline-after/index.js @@ -65,7 +65,7 @@ const rule = (primary, _secondaryOptions, context) => { const afterComma = params.slice(index + 1); if (primary.startsWith('always')) { - params = /^\s*\r?\n/.test(afterComma) + params = /^\s*\n/.test(afterComma) ? beforeComma + afterComma.replace(/^[^\S\r\n]*/, '') : beforeComma + context.newline + afterComma; } else if (primary.startsWith('never')) { diff --git a/lib/rules/mediaQueryListCommaWhitespaceChecker.js b/lib/rules/mediaQueryListCommaWhitespaceChecker.js index 3c5397f87d..21b54df202 100644 --- a/lib/rules/mediaQueryListCommaWhitespaceChecker.js +++ b/lib/rules/mediaQueryListCommaWhitespaceChecker.js @@ -29,7 +29,7 @@ module.exports = function mediaQueryListCommaWhitespaceChecker(opts) { index += execResult[0].length; } - if ((execResult = /^([^\S\r\n]*\/\/([\s\S]*?))\r?\n/.exec(params.slice(index + 1)))) { + if ((execResult = /^([^\S\r\n]*\/\/[\s\S]*?)\r?\n/.exec(params.slice(index + 1)))) { index += execResult[1].length; } } diff --git a/lib/rules/number-no-trailing-zeros/index.js b/lib/rules/number-no-trailing-zeros/index.js index c3072c146c..3e10e25d47 100644 --- a/lib/rules/number-no-trailing-zeros/index.js +++ b/lib/rules/number-no-trailing-zeros/index.js @@ -52,7 +52,7 @@ function rule(actual, secondary, context) { return; } - const match = /\.(\d*?)(0+)(?:\D|$)/.exec(valueNode.value); + const match = /\.(\d{0,100}?)(0+)(?:\D|$)/.exec(valueNode.value); // match[1] is any numbers between the decimal and our trailing zero, could be empty // match[2] is our trailing zero(s) diff --git a/lib/rules/selector-disallowed-list/__tests__/index.js b/lib/rules/selector-disallowed-list/__tests__/index.js index 1c50d78224..c78f6830aa 100644 --- a/lib/rules/selector-disallowed-list/__tests__/index.js +++ b/lib/rules/selector-disallowed-list/__tests__/index.js @@ -4,7 +4,7 @@ const { messages, ruleName } = require('..'); testRule({ ruleName, - config: ['a > .foo', /\[data-.+]/], + config: ['a > .foo', /\[data-.+\]/], accept: [ { @@ -60,7 +60,7 @@ testRule({ testRule({ ruleName, - config: [/\.foo.*>.*\.bar/], + config: [/\.foo[^>]*>.*\.bar/], accept: [ { diff --git a/lib/rules/string-no-newline/index.js b/lib/rules/string-no-newline/index.js index 1a29e63ea8..f8209c550e 100644 --- a/lib/rules/string-no-newline/index.js +++ b/lib/rules/string-no-newline/index.js @@ -12,7 +12,7 @@ const validateOptions = require('../../utils/validateOptions'); const valueParser = require('postcss-value-parser'); const ruleName = 'string-no-newline'; -const reNewLine = /(\r?\n)/; +const reNewLine = /\r?\n/; const messages = ruleMessages(ruleName, { rejected: 'Unexpected newline in string', @@ -52,7 +52,9 @@ function rule(actual) { parseSelector(ruleNode.selector, result, ruleNode, (selectorTree) => { selectorTree.walkAttributes((attributeNode) => { - if (!reNewLine.test(attributeNode.value)) { + const match = reNewLine.exec(attributeNode.value); + + if (!match) { return; } @@ -62,7 +64,7 @@ function rule(actual) { // length of our operator , ie '=' attributeNode.operator, // length of the contents before newline - RegExp.leftContext, + match.input.slice(0, match.index), ].reduce( (index, str) => index + str.length, // index of the start of our attribute node in our source @@ -88,7 +90,13 @@ function rule(actual) { } valueParser(value).walk((valueNode) => { - if (valueNode.type !== 'string' || !reNewLine.test(valueNode.value)) { + if (valueNode.type !== 'string') { + return; + } + + const match = reNewLine.exec(valueNode.value); + + if (!match) { return; } @@ -96,7 +104,7 @@ function rule(actual) { // length of the quote valueNode.quote, // length of the contents before newline - RegExp.leftContext, + match.input.slice(0, match.index), ].reduce((index, str) => index + str.length, valueNode.sourceIndex); report({ diff --git a/lib/rules/unit-disallowed-list/index.js b/lib/rules/unit-disallowed-list/index.js index f6310cab1b..6bfec7142b 100644 --- a/lib/rules/unit-disallowed-list/index.js +++ b/lib/rules/unit-disallowed-list/index.js @@ -25,7 +25,7 @@ const messages = ruleMessages(ruleName, { const getMediaFeatureName = (mediaFeatureNode) => { const value = mediaFeatureNode.value.toLowerCase(); - return /((-?\w*)*)/i.exec(value)[1]; + return /((?:-?\w*)*)/.exec(value)[1]; }; function rule(listInput, options) { diff --git a/lib/utils/hasLessInterpolation.js b/lib/utils/hasLessInterpolation.js index b3afa83e23..c8012aa716 100644 --- a/lib/utils/hasLessInterpolation.js +++ b/lib/utils/hasLessInterpolation.js @@ -7,5 +7,5 @@ * @return {boolean} If `true`, a string has less interpolation */ module.exports = function (string) { - return /@{.+?}/.test(string); + return /@\{.+?\}/.test(string); }; diff --git a/lib/utils/hasScssInterpolation.js b/lib/utils/hasScssInterpolation.js index 488c1300d9..ce80eb79df 100644 --- a/lib/utils/hasScssInterpolation.js +++ b/lib/utils/hasScssInterpolation.js @@ -6,5 +6,5 @@ * @param {string} string */ module.exports = function (string) { - return /#{.+?}/.test(string); + return /#\{.+?\}/.test(string); }; diff --git a/lib/utils/hasTplInterpolation.js b/lib/utils/hasTplInterpolation.js index d4c4485199..440319bd12 100644 --- a/lib/utils/hasTplInterpolation.js +++ b/lib/utils/hasTplInterpolation.js @@ -7,5 +7,5 @@ * @return {boolean} If `true`, a string has template literal interpolation */ module.exports = function (string) { - return /{.+?}/.test(string); + return /\{.+?\}/.test(string); }; diff --git a/lib/utils/isKeyframeSelector.js b/lib/utils/isKeyframeSelector.js index f8abba0505..6fd062cd0a 100644 --- a/lib/utils/isKeyframeSelector.js +++ b/lib/utils/isKeyframeSelector.js @@ -14,7 +14,7 @@ module.exports = function (selector) { } // Percentages - if (/^(?:\d+\.?\d*|\d*\.?\d+)%$/.test(selector)) { + if (/^(?:\d+|\d*\.\d+)%$/.test(selector)) { return true; } diff --git a/lib/utils/isStandardSyntaxMediaFeatureName.js b/lib/utils/isStandardSyntaxMediaFeatureName.js index f608c6153b..7576bada02 100644 --- a/lib/utils/isStandardSyntaxMediaFeatureName.js +++ b/lib/utils/isStandardSyntaxMediaFeatureName.js @@ -8,7 +8,7 @@ */ module.exports = function (mediaFeatureName) { // SCSS interpolation - if (/#{.+?}|\$.+?/.test(mediaFeatureName)) { + if (/#\{.+?\}|\$.+/.test(mediaFeatureName)) { return false; } diff --git a/lib/utils/isStandardSyntaxSelector.js b/lib/utils/isStandardSyntaxSelector.js index dd74d29e7d..4c6aaaabd1 100644 --- a/lib/utils/isStandardSyntaxSelector.js +++ b/lib/utils/isStandardSyntaxSelector.js @@ -25,12 +25,12 @@ module.exports = function (selector) { } // Less :extend() - if (/:extend(\(.*?\))?/.test(selector)) { + if (/:extend(?:\(.*?\))?/.test(selector)) { return false; } // Less mixin with resolved nested selectors (e.g. .foo().bar or .foo(@a, @b)[bar]) - if (/\.[\w-]+\(.*\).+/i.test(selector)) { + if (/\.[\w-]+\(.*\).+/.test(selector)) { return false; } diff --git a/lib/utils/isStandardSyntaxUrl.js b/lib/utils/isStandardSyntaxUrl.js index 3fc7ffa3a3..b4b9326e11 100644 --- a/lib/utils/isStandardSyntaxUrl.js +++ b/lib/utils/isStandardSyntaxUrl.js @@ -40,7 +40,7 @@ module.exports = function (url) { // In url without quotes scss variable can be everywhere // But in this case it is allowed to use only specific characters // Also forbidden "/" at the end of url - if (url.includes('$') && /^[$\s\w+-/*'"/]+$/.test(url) && !url.endsWith('/')) { + if (url.includes('$') && /^[$\s\w+\-,./*'"]+$/.test(url) && !url.endsWith('/')) { return false; } diff --git a/lib/utils/removeEmptyLinesAfter.js b/lib/utils/removeEmptyLinesAfter.js index 13ed803bd1..d1e8bdf8db 100644 --- a/lib/utils/removeEmptyLinesAfter.js +++ b/lib/utils/removeEmptyLinesAfter.js @@ -9,7 +9,7 @@ * @returns {T} */ module.exports = function removeEmptyLinesAfter(node, newline) { - node.raws.after = node.raws.after ? node.raws.after.replace(/(\r?\n\s*\r?\n)+/g, newline) : ''; + node.raws.after = node.raws.after ? node.raws.after.replace(/(\r?\n\s*\n)+/g, newline) : ''; return node; }; diff --git a/lib/utils/removeEmptyLinesBefore.js b/lib/utils/removeEmptyLinesBefore.js index 06b018e128..7312419bc7 100644 --- a/lib/utils/removeEmptyLinesBefore.js +++ b/lib/utils/removeEmptyLinesBefore.js @@ -9,7 +9,7 @@ * @returns {T} */ module.exports = function removeEmptyLinesBefore(node, newline) { - node.raws.before = node.raws.before ? node.raws.before.replace(/(\r?\n\s*\r?\n)+/g, newline) : ''; + node.raws.before = node.raws.before ? node.raws.before.replace(/(\r?\n\s*\n)+/g, newline) : ''; return node; }; diff --git a/package-lock.json b/package-lock.json index f3b523c457..7d60f53560 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,7 +73,7 @@ "common-tags": "^1.8.0", "deepmerge": "^4.2.2", "eslint": "^7.32.0", - "eslint-config-stylelint": "^13.1.1", + "eslint-config-stylelint": "^14.0.0", "got": "^11.8.2", "husky": "^7.0.2", "jest": "^27.2.0", @@ -1330,9 +1330,9 @@ "dev": true }, "node_modules/@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, "node_modules/@types/keyv": { @@ -1507,17 +1507,17 @@ "dev": true }, "node_modules/@typescript-eslint/experimental-utils": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.23.0.tgz", - "integrity": "sha512-WAFNiTDnQfrF3Z2fQ05nmCgPsO5o790vOhmWKXbbYQTO9erE1/YsFot5/LnOUizLzU2eeuz6+U/81KV5/hFTGA==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.1.tgz", + "integrity": "sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==", "dev": true, "dependencies": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.23.0", - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/typescript-estree": "4.23.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.31.1", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/typescript-estree": "4.31.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" }, "engines": { "node": "^10.12.0 || >=12.0.0" @@ -1530,14 +1530,32 @@ "eslint": "*" } }, + "node_modules/@typescript-eslint/experimental-utils/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } + }, "node_modules/@typescript-eslint/scope-manager": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.23.0.tgz", - "integrity": "sha512-ZZ21PCFxPhI3n0wuqEJK9omkw51wi2bmeKJvlRZPH5YFkcawKOuRMQMnI8mH6Vo0/DoHSeZJnHiIx84LmVQY+w==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.1.tgz", + "integrity": "sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/visitor-keys": "4.23.0" + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/visitor-keys": "4.31.1" }, "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" @@ -1548,9 +1566,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.23.0.tgz", - "integrity": "sha512-oqkNWyG2SLS7uTWLZf6Sr7Dm02gA5yxiz1RP87tvsmDsguVATdpVguHr4HoGOcFOpCvx9vtCSCyQUGfzq28YCw==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.1.tgz", + "integrity": "sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ==", "dev": true, "engines": { "node": "^8.10.0 || ^10.13.0 || >=11.10.1" @@ -1561,18 +1579,18 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.23.0.tgz", - "integrity": "sha512-5Sty6zPEVZF5fbvrZczfmLCOcby3sfrSPu30qKoY1U3mca5/jvU5cwsPb/CO6Q3ByRjixTMIVsDkqwIxCf/dMw==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.1.tgz", + "integrity": "sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/visitor-keys": "4.23.0", - "debug": "^4.1.1", - "globby": "^11.0.1", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/visitor-keys": "4.31.1", + "debug": "^4.3.1", + "globby": "^11.0.3", "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "engines": { "node": "^10.12.0 || >=12.0.0" @@ -1603,12 +1621,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.23.0.tgz", - "integrity": "sha512-5PNe5cmX9pSifit0H+nPoQBXdbNzi5tOEec+3riK+ku4e3er37pKxMKDH5Ct5Y4fhWxcD4spnlYjxi9vXbSpwg==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.1.tgz", + "integrity": "sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "4.23.0", + "@typescript-eslint/types": "4.31.1", "eslint-visitor-keys": "^2.0.0" }, "engines": { @@ -2560,6 +2578,15 @@ "node": ">= 10" } }, + "node_modules/comment-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", + "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/common-tags": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", @@ -3271,17 +3298,16 @@ } }, "node_modules/eslint-config-stylelint": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/eslint-config-stylelint/-/eslint-config-stylelint-13.1.1.tgz", - "integrity": "sha512-qk74J/gGNyNz0/lYvWoXJmM6XgTFdtI6VPFvp6eLRVOBKGMLDQHmzIVjnzPw1PrRslsMnqTHOKLYFnFjaTED8Q==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-stylelint/-/eslint-config-stylelint-14.0.0.tgz", + "integrity": "sha512-/HAEjiNNVOvSAs4J+z9G/Ybk8G8/nLy8hjzISHDZU27Cnx2BwAGFdqXnStucER8rkVnaaFyEM7p+GIC2Zzp6dA==", "dev": true, - "license": "MIT", "dependencies": { "eslint-config-prettier": "^8.3.0", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-jest": "^24.3.6", + "eslint-plugin-jest": "^24.4.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-sort-requires": "^2.1.0" + "eslint-plugin-regexp": "^1.1.0" } }, "node_modules/eslint-plugin-es": { @@ -3320,9 +3346,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "24.3.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.3.6.tgz", - "integrity": "sha512-WOVH4TIaBLIeCX576rLcOgjNXqP+jNlCiEmRgFTfQtJ52DpwnIQKAVGlGPAN7CZ33bW6eNfHD6s8ZbEUTQubJg==", + "version": "24.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.4.0.tgz", + "integrity": "sha512-8qnt/hgtZ94E9dA6viqfViKBfkJwFHXgJmTWlMGDgunw1XJEGqm3eiPjDsTanM3/u/3Az82nyQM9GX7PM/QGmg==", "dev": true, "dependencies": { "@typescript-eslint/experimental-utils": "^4.0.1" @@ -3366,11 +3392,44 @@ "semver": "bin/semver.js" } }, - "node_modules/eslint-plugin-sort-requires": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-sort-requires/-/eslint-plugin-sort-requires-2.1.0.tgz", - "integrity": "sha1-PvrZSNyDeYIZ6An1QGfEDlVESGE=", - "dev": true + "node_modules/eslint-plugin-regexp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-1.1.0.tgz", + "integrity": "sha512-mbDJigs9cAzDx7RDiEYXY0muX+BL8EJIG6wskYktGHFMZsuG8vJRBV4Co2wngeYJpB9S914M64T9reDr2bxTCg==", + "dev": true, + "dependencies": { + "comment-parser": "^1.1.2", + "eslint-utils": "^3.0.0", + "jsdoctypeparser": "^9.0.0", + "refa": "^0.9.0", + "regexp-ast-analysis": "^0.2.4", + "regexpp": "^3.2.0", + "scslre": "^0.1.6" + }, + "engines": { + "node": "^12 || >=14" + }, + "peerDependencies": { + "eslint": ">=6.0.0" + } + }, + "node_modules/eslint-plugin-regexp/node_modules/eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "dependencies": { + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" + } }, "node_modules/eslint-scope": { "version": "5.1.1", @@ -5985,6 +6044,18 @@ "js-yaml": "bin/js-yaml.js" } }, + "node_modules/jsdoctypeparser": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", + "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", + "dev": true, + "bin": { + "jsdoctypeparser": "bin/jsdoctypeparser" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jsdom": { "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", @@ -9265,13 +9336,35 @@ "node": ">=8" } }, + "node_modules/refa": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/refa/-/refa-0.9.1.tgz", + "integrity": "sha512-egU8LgFq2VXlAfUi8Jcbr5X38wEOadMFf8tCbshgcpVCYlE7k84pJOSlnvXF+muDB4igkdVMq7Z/kiNPqDT9TA==", + "dev": true, + "dependencies": { + "regexpp": "^3.2.0" + } + }, + "node_modules/regexp-ast-analysis": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.2.4.tgz", + "integrity": "sha512-8L7kOZQaKPxKKAwGuUZxTQtlO3WZ+tiXy4s6G6PKL6trbOXcZoumwC3AOHHFtI/xoSbNxt7jgLvCnP1UADLWqg==", + "dev": true, + "dependencies": { + "refa": "^0.9.0", + "regexpp": "^3.2.0" + } + }, "node_modules/regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, "node_modules/registry-auth-token": { @@ -10684,6 +10777,17 @@ "node": ">=8" } }, + "node_modules/scslre": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.1.6.tgz", + "integrity": "sha512-JORxVRlQTfjvlOAaiQKebgFElyAm5/W8b50lgaZ0OkEnKnagJW2ufDh3xRfU75UD9z3FGIu1gL1IyR3Poa6Qmw==", + "dev": true, + "dependencies": { + "refa": "^0.9.0", + "regexp-ast-analysis": "^0.2.3", + "regexpp": "^3.2.0" + } + }, "node_modules/semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", @@ -13539,9 +13643,9 @@ "dev": true }, "@types/json-schema": { - "version": "7.0.7", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.7.tgz", - "integrity": "sha512-cxWFQVseBm6O9Gbw1IWb8r6OS4OhSt3hPZLkFApLjM8TEXROBuQGLAH2i2gZpcXdLBIrpXuTDhH7Vbm1iXmNGA==", + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==", "dev": true }, "@types/keyv": { @@ -13716,48 +13820,59 @@ "dev": true }, "@typescript-eslint/experimental-utils": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.23.0.tgz", - "integrity": "sha512-WAFNiTDnQfrF3Z2fQ05nmCgPsO5o790vOhmWKXbbYQTO9erE1/YsFot5/LnOUizLzU2eeuz6+U/81KV5/hFTGA==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-4.31.1.tgz", + "integrity": "sha512-NtoPsqmcSsWty0mcL5nTZXMf7Ei0Xr2MT8jWjXMVgRK0/1qeQ2jZzLFUh4QtyJ4+/lPUyMw5cSfeeME+Zrtp9Q==", "dev": true, "requires": { - "@types/json-schema": "^7.0.3", - "@typescript-eslint/scope-manager": "4.23.0", - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/typescript-estree": "4.23.0", - "eslint-scope": "^5.0.0", - "eslint-utils": "^2.0.0" + "@types/json-schema": "^7.0.7", + "@typescript-eslint/scope-manager": "4.31.1", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/typescript-estree": "4.31.1", + "eslint-scope": "^5.1.1", + "eslint-utils": "^3.0.0" + }, + "dependencies": { + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + } } }, "@typescript-eslint/scope-manager": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.23.0.tgz", - "integrity": "sha512-ZZ21PCFxPhI3n0wuqEJK9omkw51wi2bmeKJvlRZPH5YFkcawKOuRMQMnI8mH6Vo0/DoHSeZJnHiIx84LmVQY+w==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-4.31.1.tgz", + "integrity": "sha512-N1Uhn6SqNtU2XpFSkD4oA+F0PfKdWHyr4bTX0xTj8NRx1314gBDRL1LUuZd5+L3oP+wo6hCbZpaa1in6SwMcVQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/visitor-keys": "4.23.0" + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/visitor-keys": "4.31.1" } }, "@typescript-eslint/types": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.23.0.tgz", - "integrity": "sha512-oqkNWyG2SLS7uTWLZf6Sr7Dm02gA5yxiz1RP87tvsmDsguVATdpVguHr4HoGOcFOpCvx9vtCSCyQUGfzq28YCw==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-4.31.1.tgz", + "integrity": "sha512-kixltt51ZJGKENNW88IY5MYqTBA8FR0Md8QdGbJD2pKZ+D5IvxjTYDNtJPDxFBiXmka2aJsITdB1BtO1fsgmsQ==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.23.0.tgz", - "integrity": "sha512-5Sty6zPEVZF5fbvrZczfmLCOcby3sfrSPu30qKoY1U3mca5/jvU5cwsPb/CO6Q3ByRjixTMIVsDkqwIxCf/dMw==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-4.31.1.tgz", + "integrity": "sha512-EGHkbsUvjFrvRnusk6yFGqrqMBTue5E5ROnS5puj3laGQPasVUgwhrxfcgkdHNFECHAewpvELE1Gjv0XO3mdWg==", "dev": true, "requires": { - "@typescript-eslint/types": "4.23.0", - "@typescript-eslint/visitor-keys": "4.23.0", - "debug": "^4.1.1", - "globby": "^11.0.1", + "@typescript-eslint/types": "4.31.1", + "@typescript-eslint/visitor-keys": "4.31.1", + "debug": "^4.3.1", + "globby": "^11.0.3", "is-glob": "^4.0.1", - "semver": "^7.3.2", - "tsutils": "^3.17.1" + "semver": "^7.3.5", + "tsutils": "^3.21.0" }, "dependencies": { "semver": { @@ -13772,12 +13887,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "4.23.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.23.0.tgz", - "integrity": "sha512-5PNe5cmX9pSifit0H+nPoQBXdbNzi5tOEec+3riK+ku4e3er37pKxMKDH5Ct5Y4fhWxcD4spnlYjxi9vXbSpwg==", + "version": "4.31.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-4.31.1.tgz", + "integrity": "sha512-PCncP8hEqKw6SOJY+3St4LVtoZpPPn+Zlpm7KW5xnviMhdqcsBty4Lsg4J/VECpJjw1CkROaZhH4B8M1OfnXTQ==", "dev": true, "requires": { - "@typescript-eslint/types": "4.23.0", + "@typescript-eslint/types": "4.31.1", "eslint-visitor-keys": "^2.0.0" } }, @@ -14507,6 +14622,12 @@ "integrity": "sha512-QrWXB+ZQSVPmIWIhtEO9H+gwHaMGYiF5ChvoJ+K9ZGHG/sVsa6yiesAD1GC/x46sET00Xlwo1u49RVVVzvcSkw==", "dev": true }, + "comment-parser": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", + "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", + "dev": true + }, "common-tags": { "version": "1.8.0", "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.0.tgz", @@ -15088,16 +15209,16 @@ "requires": {} }, "eslint-config-stylelint": { - "version": "13.1.1", - "resolved": "https://registry.npmjs.org/eslint-config-stylelint/-/eslint-config-stylelint-13.1.1.tgz", - "integrity": "sha512-qk74J/gGNyNz0/lYvWoXJmM6XgTFdtI6VPFvp6eLRVOBKGMLDQHmzIVjnzPw1PrRslsMnqTHOKLYFnFjaTED8Q==", + "version": "14.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-stylelint/-/eslint-config-stylelint-14.0.0.tgz", + "integrity": "sha512-/HAEjiNNVOvSAs4J+z9G/Ybk8G8/nLy8hjzISHDZU27Cnx2BwAGFdqXnStucER8rkVnaaFyEM7p+GIC2Zzp6dA==", "dev": true, "requires": { "eslint-config-prettier": "^8.3.0", "eslint-plugin-eslint-comments": "^3.2.0", - "eslint-plugin-jest": "^24.3.6", + "eslint-plugin-jest": "^24.4.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-sort-requires": "^2.1.0" + "eslint-plugin-regexp": "^1.1.0" } }, "eslint-plugin-es": { @@ -15129,9 +15250,9 @@ } }, "eslint-plugin-jest": { - "version": "24.3.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.3.6.tgz", - "integrity": "sha512-WOVH4TIaBLIeCX576rLcOgjNXqP+jNlCiEmRgFTfQtJ52DpwnIQKAVGlGPAN7CZ33bW6eNfHD6s8ZbEUTQubJg==", + "version": "24.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-24.4.0.tgz", + "integrity": "sha512-8qnt/hgtZ94E9dA6viqfViKBfkJwFHXgJmTWlMGDgunw1XJEGqm3eiPjDsTanM3/u/3Az82nyQM9GX7PM/QGmg==", "dev": true, "requires": { "@typescript-eslint/experimental-utils": "^4.0.1" @@ -15159,11 +15280,31 @@ } } }, - "eslint-plugin-sort-requires": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-sort-requires/-/eslint-plugin-sort-requires-2.1.0.tgz", - "integrity": "sha1-PvrZSNyDeYIZ6An1QGfEDlVESGE=", - "dev": true + "eslint-plugin-regexp": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-1.1.0.tgz", + "integrity": "sha512-mbDJigs9cAzDx7RDiEYXY0muX+BL8EJIG6wskYktGHFMZsuG8vJRBV4Co2wngeYJpB9S914M64T9reDr2bxTCg==", + "dev": true, + "requires": { + "comment-parser": "^1.1.2", + "eslint-utils": "^3.0.0", + "jsdoctypeparser": "^9.0.0", + "refa": "^0.9.0", + "regexp-ast-analysis": "^0.2.4", + "regexpp": "^3.2.0", + "scslre": "^0.1.6" + }, + "dependencies": { + "eslint-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, + "requires": { + "eslint-visitor-keys": "^2.0.0" + } + } + } }, "eslint-scope": { "version": "5.1.1", @@ -17129,6 +17270,12 @@ "esprima": "^4.0.0" } }, + "jsdoctypeparser": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-9.0.0.tgz", + "integrity": "sha512-jrTA2jJIL6/DAEILBEh2/w9QxCuwmvNXIry39Ay/HVfhE3o2yVV0U44blYkqdHA/OKloJEqvJy0xU+GSdE2SIw==", + "dev": true + }, "jsdom": { "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", @@ -19551,10 +19698,29 @@ "strip-indent": "^3.0.0" } }, + "refa": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/refa/-/refa-0.9.1.tgz", + "integrity": "sha512-egU8LgFq2VXlAfUi8Jcbr5X38wEOadMFf8tCbshgcpVCYlE7k84pJOSlnvXF+muDB4igkdVMq7Z/kiNPqDT9TA==", + "dev": true, + "requires": { + "regexpp": "^3.2.0" + } + }, + "regexp-ast-analysis": { + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/regexp-ast-analysis/-/regexp-ast-analysis-0.2.4.tgz", + "integrity": "sha512-8L7kOZQaKPxKKAwGuUZxTQtlO3WZ+tiXy4s6G6PKL6trbOXcZoumwC3AOHHFtI/xoSbNxt7jgLvCnP1UADLWqg==", + "dev": true, + "requires": { + "refa": "^0.9.0", + "regexpp": "^3.2.0" + } + }, "regexpp": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", "dev": true }, "registry-auth-token": { @@ -20675,6 +20841,17 @@ "integrity": "sha512-g3WxHrqSWCZHGHlSrF51VXFdjImhwvH8ZO/pryFH56Qi0cDsZfylQa/t0jCzVQFNbNvM00HfHjkDPEuarKDSWQ==", "dev": true }, + "scslre": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/scslre/-/scslre-0.1.6.tgz", + "integrity": "sha512-JORxVRlQTfjvlOAaiQKebgFElyAm5/W8b50lgaZ0OkEnKnagJW2ufDh3xRfU75UD9z3FGIu1gL1IyR3Poa6Qmw==", + "dev": true, + "requires": { + "refa": "^0.9.0", + "regexp-ast-analysis": "^0.2.3", + "regexpp": "^3.2.0" + } + }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", diff --git a/package.json b/package.json index 2c48a87d37..cfd0f366a7 100644 --- a/package.json +++ b/package.json @@ -61,6 +61,9 @@ "stylelint" ], "globals": { + "__dirname": true, + "module": true, + "require": true, "testRule": true }, "root": true @@ -168,7 +171,7 @@ "common-tags": "^1.8.0", "deepmerge": "^4.2.2", "eslint": "^7.32.0", - "eslint-config-stylelint": "^13.1.1", + "eslint-config-stylelint": "^14.0.0", "got": "^11.8.2", "husky": "^7.0.2", "jest": "^27.2.0",