From bc55fa1b53b3e93036f9614203f024d0fc3fab53 Mon Sep 17 00:00:00 2001 From: Roman Komarov Date: Tue, 14 Feb 2023 12:37:23 +0100 Subject: [PATCH 1/3] Add `messageArgs` to 76 rules (#6589) Co-authored-by: Richard Hallows --- .changeset/message-args.md | 5 +++++ lib/rules/alpha-value-notation/README.md | 2 ++ lib/rules/alpha-value-notation/index.js | 3 ++- lib/rules/annotation-no-unknown/README.md | 2 ++ lib/rules/annotation-no-unknown/index.js | 3 ++- lib/rules/at-rule-allowed-list/README.md | 2 ++ lib/rules/at-rule-allowed-list/index.js | 3 ++- lib/rules/at-rule-no-unknown/README.md | 2 ++ lib/rules/at-rule-no-unknown/index.js | 3 ++- lib/rules/at-rule-no-vendor-prefix/README.md | 2 ++ lib/rules/at-rule-no-vendor-prefix/index.js | 3 ++- lib/rules/at-rule-property-required-list/README.md | 2 ++ .../__tests__/index.js | 8 ++++---- lib/rules/at-rule-property-required-list/index.js | 5 +++-- lib/rules/color-function-notation/README.md | 2 ++ lib/rules/color-function-notation/index.js | 3 ++- lib/rules/color-hex-alpha/README.md | 2 ++ lib/rules/color-hex-alpha/index.js | 3 ++- lib/rules/color-hex-length/README.md | 2 ++ lib/rules/color-hex-length/index.js | 3 ++- lib/rules/color-no-invalid-hex/README.md | 2 ++ lib/rules/color-no-invalid-hex/index.js | 3 ++- lib/rules/comment-pattern/README.md | 2 ++ lib/rules/comment-pattern/index.js | 3 ++- lib/rules/comment-word-disallowed-list/README.md | 2 ++ lib/rules/comment-word-disallowed-list/index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- .../README.md | 2 ++ .../index.js | 6 ++++-- .../README.md | 2 ++ .../index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- .../declaration-property-max-values/README.md | 2 ++ lib/rules/declaration-property-max-values/index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- lib/rules/function-allowed-list/README.md | 2 ++ lib/rules/function-allowed-list/index.js | 3 ++- lib/rules/function-name-case/README.md | 2 ++ lib/rules/function-name-case/index.js | 3 ++- lib/rules/function-no-unknown/README.md | 2 ++ lib/rules/function-no-unknown/index.js | 3 ++- .../function-url-scheme-allowed-list/README.md | 2 ++ .../function-url-scheme-allowed-list/index.js | 3 ++- .../function-url-scheme-disallowed-list/README.md | 2 ++ .../function-url-scheme-disallowed-list/index.js | 3 ++- lib/rules/hue-degree-notation/README.md | 2 ++ lib/rules/hue-degree-notation/index.js | 3 ++- .../README.md | 2 ++ .../keyframe-block-no-duplicate-selectors/index.js | 3 ++- lib/rules/keyframe-selector-notation/README.md | 2 ++ lib/rules/keyframe-selector-notation/index.js | 3 ++- lib/rules/max-nesting-depth/README.md | 2 ++ lib/rules/max-nesting-depth/index.js | 3 ++- .../media-feature-name-allowed-list/README.md | 2 ++ lib/rules/media-feature-name-allowed-list/index.js | 3 ++- .../media-feature-name-disallowed-list/README.md | 2 ++ .../media-feature-name-disallowed-list/index.js | 3 ++- lib/rules/media-feature-name-no-unknown/README.md | 2 ++ lib/rules/media-feature-name-no-unknown/index.js | 3 ++- .../README.md | 2 ++ .../media-feature-name-value-allowed-list/index.js | 3 ++- lib/rules/media-feature-range-notation/README.md | 2 ++ lib/rules/media-feature-range-notation/index.js | 3 ++- lib/rules/no-descending-specificity/README.md | 2 ++ lib/rules/no-descending-specificity/index.js | 3 ++- lib/rules/no-duplicate-at-import-rules/README.md | 2 ++ lib/rules/no-duplicate-at-import-rules/index.js | 3 ++- lib/rules/no-duplicate-selectors/README.md | 2 ++ lib/rules/no-duplicate-selectors/index.js | 6 ++++-- lib/rules/no-unknown-animations/README.md | 2 ++ lib/rules/no-unknown-animations/index.js | 3 ++- lib/rules/number-max-precision/README.md | 2 ++ lib/rules/number-max-precision/index.js | 3 ++- lib/rules/property-allowed-list/README.md | 2 ++ lib/rules/property-allowed-list/index.js | 3 ++- lib/rules/property-no-unknown/README.md | 2 ++ lib/rules/property-no-unknown/index.js | 3 ++- lib/rules/property-no-vendor-prefix/README.md | 2 ++ lib/rules/property-no-vendor-prefix/index.js | 3 ++- .../README.md | 2 ++ .../__tests__/index.js | 14 +++++++------- .../index.js | 5 +++-- .../README.md | 2 ++ .../index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- .../selector-combinator-allowed-list/README.md | 2 ++ .../selector-combinator-allowed-list/index.js | 3 ++- .../selector-combinator-disallowed-list/README.md | 2 ++ .../selector-combinator-disallowed-list/index.js | 3 ++- lib/rules/selector-disallowed-list/README.md | 2 ++ lib/rules/selector-disallowed-list/index.js | 6 ++++-- lib/rules/selector-max-attribute/README.md | 2 ++ lib/rules/selector-max-attribute/index.js | 3 ++- lib/rules/selector-max-class/README.md | 2 ++ lib/rules/selector-max-class/index.js | 3 ++- lib/rules/selector-max-combinators/README.md | 2 ++ lib/rules/selector-max-combinators/index.js | 3 ++- .../selector-max-compound-selectors/README.md | 2 ++ lib/rules/selector-max-compound-selectors/index.js | 3 ++- lib/rules/selector-max-id/README.md | 2 ++ lib/rules/selector-max-id/index.js | 3 ++- lib/rules/selector-max-pseudo-class/README.md | 2 ++ lib/rules/selector-max-pseudo-class/index.js | 3 ++- lib/rules/selector-max-specificity/README.md | 2 ++ lib/rules/selector-max-specificity/index.js | 3 ++- lib/rules/selector-max-type/README.md | 2 ++ lib/rules/selector-max-type/index.js | 3 ++- lib/rules/selector-max-universal/README.md | 2 ++ lib/rules/selector-max-universal/index.js | 3 ++- lib/rules/selector-no-qualifying-type/README.md | 2 ++ lib/rules/selector-no-qualifying-type/index.js | 3 ++- lib/rules/selector-no-vendor-prefix/README.md | 2 ++ lib/rules/selector-no-vendor-prefix/index.js | 3 ++- lib/rules/selector-not-notation/README.md | 2 ++ lib/rules/selector-not-notation/index.js | 3 ++- .../selector-pseudo-class-allowed-list/README.md | 2 ++ .../selector-pseudo-class-allowed-list/index.js | 3 ++- .../README.md | 2 ++ .../selector-pseudo-class-disallowed-list/index.js | 3 ++- .../selector-pseudo-class-no-unknown/README.md | 2 ++ .../selector-pseudo-class-no-unknown/index.js | 3 ++- .../selector-pseudo-element-allowed-list/README.md | 2 ++ .../selector-pseudo-element-allowed-list/index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- .../selector-pseudo-element-no-unknown/README.md | 2 ++ .../selector-pseudo-element-no-unknown/index.js | 3 ++- lib/rules/selector-type-case/README.md | 2 ++ lib/rules/selector-type-case/index.js | 3 ++- lib/rules/selector-type-no-unknown/README.md | 2 ++ lib/rules/selector-type-no-unknown/index.js | 3 ++- .../README.md | 2 ++ .../index.js | 3 ++- lib/rules/time-min-milliseconds/README.md | 2 ++ lib/rules/time-min-milliseconds/index.js | 3 ++- lib/rules/unit-allowed-list/README.md | 2 ++ lib/rules/unit-allowed-list/index.js | 3 ++- lib/rules/unit-disallowed-list/README.md | 2 ++ lib/rules/unit-disallowed-list/index.js | 3 ++- lib/rules/unit-no-unknown/README.md | 2 ++ lib/rules/unit-no-unknown/index.js | 3 ++- lib/rules/value-keyword-case/README.md | 2 ++ lib/rules/value-keyword-case/index.js | 3 ++- lib/rules/value-no-vendor-prefix/README.md | 2 ++ lib/rules/value-no-vendor-prefix/index.js | 3 ++- 155 files changed, 328 insertions(+), 92 deletions(-) create mode 100644 .changeset/message-args.md diff --git a/.changeset/message-args.md b/.changeset/message-args.md new file mode 100644 index 0000000000..e006b6a21c --- /dev/null +++ b/.changeset/message-args.md @@ -0,0 +1,5 @@ +--- +"stylelint": minor +--- + +Added: `messageArgs` to 76 rules diff --git a/lib/rules/alpha-value-notation/README.md b/lib/rules/alpha-value-notation/README.md index 2c811d7186..454ff80db0 100644 --- a/lib/rules/alpha-value-notation/README.md +++ b/lib/rules/alpha-value-notation/README.md @@ -11,6 +11,8 @@ Specify percentage or number notation for alpha-values. The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"number"|"percentage"` diff --git a/lib/rules/alpha-value-notation/index.js b/lib/rules/alpha-value-notation/index.js index 20c0354172..21c4ac653d 100644 --- a/lib/rules/alpha-value-notation/index.js +++ b/lib/rules/alpha-value-notation/index.js @@ -119,7 +119,8 @@ const rule = (primary, secondaryOptions, context) => { const endIndex = index + alpha.value.length; report({ - message: messages.expected(unfixed, fixed), + message: messages.expected, + messageArgs: [unfixed, fixed], node: decl, index, endIndex, diff --git a/lib/rules/annotation-no-unknown/README.md b/lib/rules/annotation-no-unknown/README.md index b7ae3b1926..f80c21e2c6 100644 --- a/lib/rules/annotation-no-unknown/README.md +++ b/lib/rules/annotation-no-unknown/README.md @@ -11,6 +11,8 @@ a { color: green !imprtant; } This rule considers annotations defined in the CSS Specifications, up to and including Editor's Drafts, to be known. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/annotation-no-unknown/index.js b/lib/rules/annotation-no-unknown/index.js index 1bcf4e2f35..6759ec13e3 100644 --- a/lib/rules/annotation-no-unknown/index.js +++ b/lib/rules/annotation-no-unknown/index.js @@ -62,7 +62,8 @@ const rule = (primary, secondaryOptions) => { } report({ - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: decl, result, ruleName, diff --git a/lib/rules/at-rule-allowed-list/README.md b/lib/rules/at-rule-allowed-list/README.md index 6a5e681eb6..baacb6f148 100644 --- a/lib/rules/at-rule-allowed-list/README.md +++ b/lib/rules/at-rule-allowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of allowed at-rules. * At-rules like this */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string`: `["array", "of", "unprefixed", "at-rules"]|"at-rule"` diff --git a/lib/rules/at-rule-allowed-list/index.js b/lib/rules/at-rule-allowed-list/index.js index ece25c136d..98d9181ab8 100644 --- a/lib/rules/at-rule-allowed-list/index.js +++ b/lib/rules/at-rule-allowed-list/index.js @@ -43,7 +43,8 @@ const rule = (primary) => { } report({ - message: messages.rejected(name), + message: messages.rejected, + messageArgs: [name], node: atRule, result, ruleName, diff --git a/lib/rules/at-rule-no-unknown/README.md b/lib/rules/at-rule-no-unknown/README.md index b8ace2658f..cb3aae08c1 100644 --- a/lib/rules/at-rule-no-unknown/README.md +++ b/lib/rules/at-rule-no-unknown/README.md @@ -11,6 +11,8 @@ Disallow unknown at-rules. This rule considers at-rules defined in the CSS Specifications, up to and including Editor's Drafts, to be known. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/at-rule-no-unknown/index.js b/lib/rules/at-rule-no-unknown/index.js index 2b9cdf4a73..58cdeaab7b 100644 --- a/lib/rules/at-rule-no-unknown/index.js +++ b/lib/rules/at-rule-no-unknown/index.js @@ -58,7 +58,8 @@ const rule = (primary, secondaryOptions) => { const atName = `@${name}`; report({ - message: messages.rejected(atName), + message: messages.rejected, + messageArgs: [atName], node: atRule, ruleName, result, diff --git a/lib/rules/at-rule-no-vendor-prefix/README.md b/lib/rules/at-rule-no-vendor-prefix/README.md index 67ced6e713..3b4472e08a 100644 --- a/lib/rules/at-rule-no-vendor-prefix/README.md +++ b/lib/rules/at-rule-no-vendor-prefix/README.md @@ -13,6 +13,8 @@ This rule ignores non-standard vendor-prefixed at-rules that aren't handled by [ The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. However, it will not remove duplicate at-rules produced when the prefixes are removed. You can use [Autoprefixer](https://github.com/postcss/autoprefixer) itself, with the [`add` option off and the `remove` option on](https://github.com/postcss/autoprefixer#options), in these situations. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/at-rule-no-vendor-prefix/index.js b/lib/rules/at-rule-no-vendor-prefix/index.js index abe0e70fb5..38a3e99f69 100644 --- a/lib/rules/at-rule-no-vendor-prefix/index.js +++ b/lib/rules/at-rule-no-vendor-prefix/index.js @@ -48,7 +48,8 @@ const rule = (primary, _secondary, context) => { } report({ - message: messages.rejected(name), + message: messages.rejected, + messageArgs: [name], node: atRule, word: `@${name}`, result, diff --git a/lib/rules/at-rule-property-required-list/README.md b/lib/rules/at-rule-property-required-list/README.md index a628c2c0d6..9598405f37 100644 --- a/lib/rules/at-rule-property-required-list/README.md +++ b/lib/rules/at-rule-property-required-list/README.md @@ -9,6 +9,8 @@ Specify a list of required properties for an at-rule. * At-rule and required property names */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `object`: `{ "at-rule-name": ["array", "of", "properties"]|"property" }` diff --git a/lib/rules/at-rule-property-required-list/__tests__/index.js b/lib/rules/at-rule-property-required-list/__tests__/index.js index 5f95df39cc..5d1c833456 100644 --- a/lib/rules/at-rule-property-required-list/__tests__/index.js +++ b/lib/rules/at-rule-property-required-list/__tests__/index.js @@ -40,7 +40,7 @@ testRule({ { code: '@font-face { font-display: auto; }', description: '@font-face with missing property', - message: messages.expected('font-family', 'font-face'), + message: messages.expected('font-face', 'font-family'), line: 1, column: 1, endLine: 1, @@ -49,7 +49,7 @@ testRule({ { code: '@FONT-FACE { FONT-DISPLAY: AUTO; }', description: '@font-face with missing property (case-sensitive)', - message: messages.expected('font-family', 'font-face'), + message: messages.expected('font-face', 'font-family'), line: 1, column: 1, endLine: 1, @@ -58,7 +58,7 @@ testRule({ { code: "@font-face { font-family: 'Arvo'; font-weight: normal }", description: '@font-face with missing property', - message: messages.expected('font-display', 'font-face'), + message: messages.expected('font-face', 'font-display'), line: 1, column: 1, endLine: 1, @@ -67,7 +67,7 @@ testRule({ { code: '@page { padding: 0.5cm }', description: '@page with missing property', - message: messages.expected('margin', 'page'), + message: messages.expected('page', 'margin'), line: 1, column: 1, endLine: 1, diff --git a/lib/rules/at-rule-property-required-list/index.js b/lib/rules/at-rule-property-required-list/index.js index e2941acaab..1e88e0b16e 100644 --- a/lib/rules/at-rule-property-required-list/index.js +++ b/lib/rules/at-rule-property-required-list/index.js @@ -11,7 +11,7 @@ const { isString } = require('../../utils/validateTypes'); const ruleName = 'at-rule-property-required-list'; const messages = ruleMessages(ruleName, { - expected: (property, atRule) => `Expected property "${property}" for at-rule "${atRule}"`, + expected: (atRule, property) => `Expected property "${property}" for at-rule "${atRule}"`, }); const meta = { @@ -55,7 +55,8 @@ const rule = (primary) => { } report({ - message: messages.expected(propertyName, atRuleName), + message: messages.expected, + messageArgs: [atRuleName, propertyName], node: atRule, word: `@${atRule.name}`, result, diff --git a/lib/rules/color-function-notation/README.md b/lib/rules/color-function-notation/README.md index c02637d0af..82a392534a 100644 --- a/lib/rules/color-function-notation/README.md +++ b/lib/rules/color-function-notation/README.md @@ -15,6 +15,8 @@ For legacy reasons, `rgb()` and `hsl()` also supports an alternate syntax that s The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix some of the problems reported by this rule when the primary option is `"modern"`. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"modern"|"legacy"` diff --git a/lib/rules/color-function-notation/index.js b/lib/rules/color-function-notation/index.js index 669ee62783..a815b6c857 100644 --- a/lib/rules/color-function-notation/index.js +++ b/lib/rules/color-function-notation/index.js @@ -88,7 +88,8 @@ const rule = (primary, _secondaryOptions, context) => { const endIndex = index + (sourceEndIndex - sourceIndex); report({ - message: messages.expected(primary), + message: messages.expected, + messageArgs: [primary], node: decl, index, endIndex, diff --git a/lib/rules/color-hex-alpha/README.md b/lib/rules/color-hex-alpha/README.md index bde0a132ae..b584f2603b 100644 --- a/lib/rules/color-hex-alpha/README.md +++ b/lib/rules/color-hex-alpha/README.md @@ -9,6 +9,8 @@ a { color: #fffa } * This alpha channel */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"always"|"never"` diff --git a/lib/rules/color-hex-alpha/index.js b/lib/rules/color-hex-alpha/index.js index f475a393e7..3098896fb4 100644 --- a/lib/rules/color-hex-alpha/index.js +++ b/lib/rules/color-hex-alpha/index.js @@ -47,7 +47,8 @@ const rule = (primary) => { const endIndex = index + value.length; report({ - message: primary === 'never' ? messages.unexpected(value) : messages.expected(value), + message: primary === 'never' ? messages.unexpected : messages.expected, + messageArgs: [value], node: decl, index, endIndex, diff --git a/lib/rules/color-hex-length/README.md b/lib/rules/color-hex-length/README.md index 854a520c9e..a54a66cb1c 100644 --- a/lib/rules/color-hex-length/README.md +++ b/lib/rules/color-hex-length/README.md @@ -11,6 +11,8 @@ a { color: #fff } The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"short"|"long"` diff --git a/lib/rules/color-hex-length/index.js b/lib/rules/color-hex-length/index.js index fdd8767d76..4e76efc986 100644 --- a/lib/rules/color-hex-length/index.js +++ b/lib/rules/color-hex-length/index.js @@ -68,7 +68,8 @@ const rule = (primary, _secondaryOptions, context) => { const endIndex = index + node.value.length; report({ - message: messages.expected(hexValue, expectedHex), + message: messages.expected, + messageArgs: [hexValue, expectedHex], node: decl, index, endIndex, diff --git a/lib/rules/color-no-invalid-hex/README.md b/lib/rules/color-no-invalid-hex/README.md index deca43eb50..96191b1334 100644 --- a/lib/rules/color-no-invalid-hex/README.md +++ b/lib/rules/color-no-invalid-hex/README.md @@ -11,6 +11,8 @@ a { color: #y3 } Longhand hex colors can be either 6 or 8 (with alpha channel) hexadecimal characters. And their shorthand variants are 3 and 4 characters respectively. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/color-no-invalid-hex/index.js b/lib/rules/color-no-invalid-hex/index.js index 9bdc132f15..b92cfcd9f3 100644 --- a/lib/rules/color-no-invalid-hex/index.js +++ b/lib/rules/color-no-invalid-hex/index.js @@ -49,7 +49,8 @@ const rule = (primary) => { const endIndex = index + hexValue.length; report({ - message: messages.rejected(hexValue), + message: messages.rejected, + messageArgs: [hexValue], node: decl, index, endIndex, diff --git a/lib/rules/comment-pattern/README.md b/lib/rules/comment-pattern/README.md index 00f9b7b0fe..f5eeb26755 100644 --- a/lib/rules/comment-pattern/README.md +++ b/lib/rules/comment-pattern/README.md @@ -9,6 +9,8 @@ Specify a pattern for comments. * The pattern of this */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `regex|string` diff --git a/lib/rules/comment-pattern/index.js b/lib/rules/comment-pattern/index.js index 84b034c88f..27226a83cc 100644 --- a/lib/rules/comment-pattern/index.js +++ b/lib/rules/comment-pattern/index.js @@ -37,7 +37,8 @@ const rule = (primary) => { } report({ - message: messages.expected(primary), + message: messages.expected, + messageArgs: [primary], node: comment, result, ruleName, diff --git a/lib/rules/comment-word-disallowed-list/README.md b/lib/rules/comment-word-disallowed-list/README.md index a68f598fce..d58d600953 100644 --- a/lib/rules/comment-word-disallowed-list/README.md +++ b/lib/rules/comment-word-disallowed-list/README.md @@ -11,6 +11,8 @@ Specify a list of disallowed words within comments. **Caveat:** Comments within _selector and value lists_ are currently ignored. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regexp`: `["array", "of", "words", /or/, "/regex/"]|"word"|"/regex/"|/regex/` diff --git a/lib/rules/comment-word-disallowed-list/index.js b/lib/rules/comment-word-disallowed-list/index.js index f044c21213..e2ba6737b4 100644 --- a/lib/rules/comment-word-disallowed-list/index.js +++ b/lib/rules/comment-word-disallowed-list/index.js @@ -46,7 +46,8 @@ const rule = (primary) => { } report({ - message: messages.rejected(matchesWord.pattern), + message: messages.rejected, + messageArgs: [matchesWord.pattern], node: comment, word: matchesWord.substring, result, diff --git a/lib/rules/custom-property-no-missing-var-function/README.md b/lib/rules/custom-property-no-missing-var-function/README.md index 7703043643..dfa97cfb98 100644 --- a/lib/rules/custom-property-no-missing-var-function/README.md +++ b/lib/rules/custom-property-no-missing-var-function/README.md @@ -12,6 +12,8 @@ Disallow missing `var` function for custom properties. This rule only reports custom properties that are defined within the same source. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/custom-property-no-missing-var-function/index.js b/lib/rules/custom-property-no-missing-var-function/index.js index 0e8c5a8649..6477997df1 100644 --- a/lib/rules/custom-property-no-missing-var-function/index.js +++ b/lib/rules/custom-property-no-missing-var-function/index.js @@ -51,7 +51,8 @@ const rule = (primary) => { const endIndex = index + node.value.length; report({ - message: messages.rejected(node.value), + message: messages.rejected, + messageArgs: [node.value], node: decl, index, endIndex, diff --git a/lib/rules/declaration-block-no-duplicate-custom-properties/README.md b/lib/rules/declaration-block-no-duplicate-custom-properties/README.md index 8ec4acc454..43043c62a7 100644 --- a/lib/rules/declaration-block-no-duplicate-custom-properties/README.md +++ b/lib/rules/declaration-block-no-duplicate-custom-properties/README.md @@ -11,6 +11,8 @@ a { --custom-property: pink; --custom-property: orange; } This rule is case-sensitive. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/declaration-block-no-duplicate-custom-properties/index.js b/lib/rules/declaration-block-no-duplicate-custom-properties/index.js index f4b242e92a..d6c219d7ed 100644 --- a/lib/rules/declaration-block-no-duplicate-custom-properties/index.js +++ b/lib/rules/declaration-block-no-duplicate-custom-properties/index.js @@ -44,7 +44,8 @@ const rule = (primary) => { if (isDuplicate) { report({ - message: messages.rejected(prop), + message: messages.rejected, + messageArgs: [prop], node: decl, result, ruleName, diff --git a/lib/rules/declaration-block-no-duplicate-properties/README.md b/lib/rules/declaration-block-no-duplicate-properties/README.md index ef97a03f01..47eeec3f62 100644 --- a/lib/rules/declaration-block-no-duplicate-properties/README.md +++ b/lib/rules/declaration-block-no-duplicate-properties/README.md @@ -13,6 +13,8 @@ This rule ignores variables (`$sass`, `@less`, `--custom-property`). The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/declaration-block-no-duplicate-properties/index.js b/lib/rules/declaration-block-no-duplicate-properties/index.js index cb755c1d64..415a1d660a 100644 --- a/lib/rules/declaration-block-no-duplicate-properties/index.js +++ b/lib/rules/declaration-block-no-duplicate-properties/index.js @@ -108,7 +108,8 @@ const rule = (primary, secondaryOptions, context) => { const fixOrReport = () => { if (!context.fix) { return report({ - message: messages.rejected(prop), + message: messages.rejected, + messageArgs: [prop], node: decl, result, ruleName, @@ -140,7 +141,8 @@ const rule = (primary, secondaryOptions, context) => { } return report({ - message: messages.rejected(prop), + message: messages.rejected, + messageArgs: [prop], node: decl, result, ruleName, diff --git a/lib/rules/declaration-block-no-redundant-longhand-properties/README.md b/lib/rules/declaration-block-no-redundant-longhand-properties/README.md index 3c6caf50d6..caf7f5ff68 100644 --- a/lib/rules/declaration-block-no-redundant-longhand-properties/README.md +++ b/lib/rules/declaration-block-no-redundant-longhand-properties/README.md @@ -68,6 +68,8 @@ Flexbox-related properties can be ignored using `ignoreShorthands: ["/flex/"]` ( The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix most of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/declaration-block-no-redundant-longhand-properties/index.js b/lib/rules/declaration-block-no-redundant-longhand-properties/index.js index 1e43c9c50d..04f14c27e3 100644 --- a/lib/rules/declaration-block-no-redundant-longhand-properties/index.js +++ b/lib/rules/declaration-block-no-redundant-longhand-properties/index.js @@ -136,7 +136,8 @@ const rule = (primary, secondaryOptions, context) => { result, node: decl, word: decl.prop, - message: messages.expected(prefixedShorthandProperty), + message: messages.expected, + messageArgs: [prefixedShorthandProperty], }); } }); diff --git a/lib/rules/declaration-block-no-shorthand-property-overrides/README.md b/lib/rules/declaration-block-no-shorthand-property-overrides/README.md index ffd281415e..69965b9795 100644 --- a/lib/rules/declaration-block-no-shorthand-property-overrides/README.md +++ b/lib/rules/declaration-block-no-shorthand-property-overrides/README.md @@ -11,6 +11,8 @@ a { background-repeat: repeat; background: green; } In almost every case, this is just an authorial oversight. For more about this behavior, see [MDN's documentation of shorthand properties](https://developer.mozilla.org/en-US/docs/Web/CSS/Shorthand_properties). +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/declaration-block-no-shorthand-property-overrides/index.js b/lib/rules/declaration-block-no-shorthand-property-overrides/index.js index fafe723611..db75f18a95 100644 --- a/lib/rules/declaration-block-no-shorthand-property-overrides/index.js +++ b/lib/rules/declaration-block-no-shorthand-property-overrides/index.js @@ -56,7 +56,8 @@ const rule = (primary) => { ruleName, result, node: decl, - message: messages.rejected(prop, declaration || ''), + message: messages.rejected, + messageArgs: [prop, declaration || ''], word: prop, }); } diff --git a/lib/rules/declaration-block-single-line-max-declarations/README.md b/lib/rules/declaration-block-single-line-max-declarations/README.md index e727ca7fde..f0de3eb813 100644 --- a/lib/rules/declaration-block-single-line-max-declarations/README.md +++ b/lib/rules/declaration-block-single-line-max-declarations/README.md @@ -9,6 +9,8 @@ a { color: pink; top: 0; } * The number of these declarations */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum number of declarations allowed. diff --git a/lib/rules/declaration-block-single-line-max-declarations/index.js b/lib/rules/declaration-block-single-line-max-declarations/index.js index 64a12a4dd4..be94985650 100644 --- a/lib/rules/declaration-block-single-line-max-declarations/index.js +++ b/lib/rules/declaration-block-single-line-max-declarations/index.js @@ -47,7 +47,8 @@ const rule = (primary) => { } report({ - message: messages.expected(primary), + message: messages.expected, + messageArgs: [primary], node: ruleNode, word: block, result, diff --git a/lib/rules/declaration-property-max-values/README.md b/lib/rules/declaration-property-max-values/README.md index 4a514b2aae..7120c8541f 100644 --- a/lib/rules/declaration-property-max-values/README.md +++ b/lib/rules/declaration-property-max-values/README.md @@ -2,6 +2,8 @@ Limit the number of values for a list of properties within declarations. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `object`: `{ "unprefixed-property-name": int }` diff --git a/lib/rules/declaration-property-max-values/index.js b/lib/rules/declaration-property-max-values/index.js index 7dce120bf7..1e57e96c29 100644 --- a/lib/rules/declaration-property-max-values/index.js +++ b/lib/rules/declaration-property-max-values/index.js @@ -62,7 +62,8 @@ const rule = (primary) => { } report({ - message: messages.rejected(prop, max), + message: messages.rejected, + messageArgs: [prop, max], node: decl, result, ruleName, diff --git a/lib/rules/declaration-property-value-allowed-list/README.md b/lib/rules/declaration-property-value-allowed-list/README.md index cff3f35c6d..05a578fc9d 100644 --- a/lib/rules/declaration-property-value-allowed-list/README.md +++ b/lib/rules/declaration-property-value-allowed-list/README.md @@ -9,6 +9,8 @@ a { text-transform: uppercase; } * These properties and these values */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `object`: `{ "unprefixed-property-name": ["array", "of", "values", "/regex/", /regex/]|"value"|"/regex/"|/regex/ }` diff --git a/lib/rules/declaration-property-value-allowed-list/index.js b/lib/rules/declaration-property-value-allowed-list/index.js index 58d4d0ca91..5f52e3f16a 100644 --- a/lib/rules/declaration-property-value-allowed-list/index.js +++ b/lib/rules/declaration-property-value-allowed-list/index.js @@ -52,7 +52,8 @@ const rule = (primary) => { const endIndex = index + decl.value.length; report({ - message: messages.rejected(prop, value), + message: messages.rejected, + messageArgs: [prop, value], node: decl, index, endIndex, diff --git a/lib/rules/function-allowed-list/README.md b/lib/rules/function-allowed-list/README.md index 0efd629e28..6674dece8c 100644 --- a/lib/rules/function-allowed-list/README.md +++ b/lib/rules/function-allowed-list/README.md @@ -9,6 +9,8 @@ a { transform: scale(1); } * This function */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", "unprefixed", /functions/, "/regex/"]|"function"|"/regex/"|/regex/` diff --git a/lib/rules/function-allowed-list/index.js b/lib/rules/function-allowed-list/index.js index fe5de3909a..e74f4d1a09 100644 --- a/lib/rules/function-allowed-list/index.js +++ b/lib/rules/function-allowed-list/index.js @@ -50,7 +50,8 @@ const rule = (primary) => { const endIndex = index + node.value.length; report({ - message: messages.rejected(node.value), + message: messages.rejected, + messageArgs: [node.value], node: decl, index, endIndex, diff --git a/lib/rules/function-name-case/README.md b/lib/rules/function-name-case/README.md index daacbcb157..358e31d164 100644 --- a/lib/rules/function-name-case/README.md +++ b/lib/rules/function-name-case/README.md @@ -13,6 +13,8 @@ Camel case function names, e.g. `translateX`, are accounted for when the `lower` The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"lower"|"upper"` diff --git a/lib/rules/function-name-case/index.js b/lib/rules/function-name-case/index.js index f0f30cfc4a..f6d129c4c7 100644 --- a/lib/rules/function-name-case/index.js +++ b/lib/rules/function-name-case/index.js @@ -93,7 +93,8 @@ const rule = (primary, secondaryOptions, context) => { } report({ - message: messages.expected(functionName, expectedFunctionName), + message: messages.expected, + messageArgs: [functionName, expectedFunctionName], node: decl, index: declarationValueIndex(decl) + node.sourceIndex, result, diff --git a/lib/rules/function-no-unknown/README.md b/lib/rules/function-no-unknown/README.md index 2b3200f2c0..24872ad8dc 100644 --- a/lib/rules/function-no-unknown/README.md +++ b/lib/rules/function-no-unknown/README.md @@ -13,6 +13,8 @@ This rule considers functions defined in the CSS Specifications to be known. This rule ignores double-dashed custom functions, e.g. `--custom-function()`. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/function-no-unknown/index.js b/lib/rules/function-no-unknown/index.js index 82a6699605..f996f71fe2 100644 --- a/lib/rules/function-no-unknown/index.js +++ b/lib/rules/function-no-unknown/index.js @@ -81,7 +81,8 @@ const rule = (primary, secondaryOptions) => { } report({ - message: messages.rejected(name), + message: messages.rejected, + messageArgs: [name], node: decl, index: declarationValueIndex(decl) + node.sourceIndex, result, diff --git a/lib/rules/function-url-scheme-allowed-list/README.md b/lib/rules/function-url-scheme-allowed-list/README.md index 2e89691e92..a8070ad5dd 100644 --- a/lib/rules/function-url-scheme-allowed-list/README.md +++ b/lib/rules/function-url-scheme-allowed-list/README.md @@ -16,6 +16,8 @@ This rule ignores: - URL arguments without an existing URL scheme - URL arguments with variables or variable interpolation (`$sass`, `@less`, `--custom-property`, `#{$var}`, `@{var}`, `$(var)`) +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", /schemes/, "/regex/"]|"scheme"|"/regex/"|/regex/` diff --git a/lib/rules/function-url-scheme-allowed-list/index.js b/lib/rules/function-url-scheme-allowed-list/index.js index 67d79ffb92..a98f30ef50 100644 --- a/lib/rules/function-url-scheme-allowed-list/index.js +++ b/lib/rules/function-url-scheme-allowed-list/index.js @@ -51,7 +51,8 @@ const rule = (primary) => { } report({ - message: messages.rejected(scheme), + message: messages.rejected, + messageArgs: [scheme], node: decl, index, endIndex: index + args.length, diff --git a/lib/rules/function-url-scheme-disallowed-list/README.md b/lib/rules/function-url-scheme-disallowed-list/README.md index 0f79a7d960..444208c40b 100644 --- a/lib/rules/function-url-scheme-disallowed-list/README.md +++ b/lib/rules/function-url-scheme-disallowed-list/README.md @@ -16,6 +16,8 @@ This rule ignores: - URL arguments without an existing URL scheme - URL arguments with variables or variable interpolation (`$sass`, `@less`, `--custom-property`, `#{$var}`, `@{var}`, `$(var)`) +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", /schemes/, "/regex/"]|"scheme"|"/regex/"|/regex/` diff --git a/lib/rules/function-url-scheme-disallowed-list/index.js b/lib/rules/function-url-scheme-disallowed-list/index.js index e6b16d9ec2..c9c5214bfe 100644 --- a/lib/rules/function-url-scheme-disallowed-list/index.js +++ b/lib/rules/function-url-scheme-disallowed-list/index.js @@ -51,7 +51,8 @@ const rule = (primary) => { } report({ - message: messages.rejected(scheme), + message: messages.rejected, + messageArgs: [scheme], node: decl, index, endIndex: index + args.length, diff --git a/lib/rules/hue-degree-notation/README.md b/lib/rules/hue-degree-notation/README.md index 918e7fb4a4..16a289334e 100644 --- a/lib/rules/hue-degree-notation/README.md +++ b/lib/rules/hue-degree-notation/README.md @@ -13,6 +13,8 @@ Because hues are so often given in degrees, a hue can also be given as a number, The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"angle"|"number"` diff --git a/lib/rules/hue-degree-notation/index.js b/lib/rules/hue-degree-notation/index.js index 215b556073..234c41d451 100644 --- a/lib/rules/hue-degree-notation/index.js +++ b/lib/rules/hue-degree-notation/index.js @@ -71,7 +71,8 @@ const rule = (primary, _secondaryOptions, context) => { const valueIndex = declarationValueIndex(decl); report({ - message: messages.expected(unfixed, fixed), + message: messages.expected, + messageArgs: [unfixed, fixed], node: decl, index: valueIndex + hue.sourceIndex, endIndex: valueIndex + hue.sourceEndIndex, diff --git a/lib/rules/keyframe-block-no-duplicate-selectors/README.md b/lib/rules/keyframe-block-no-duplicate-selectors/README.md index 07a528fc88..07b3fbcade 100644 --- a/lib/rules/keyframe-block-no-duplicate-selectors/README.md +++ b/lib/rules/keyframe-block-no-duplicate-selectors/README.md @@ -11,6 +11,8 @@ Disallow duplicate selectors within keyframe blocks. This rule is case-insensitive. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/keyframe-block-no-duplicate-selectors/index.js b/lib/rules/keyframe-block-no-duplicate-selectors/index.js index fd15d7acd5..2e064bf8e2 100644 --- a/lib/rules/keyframe-block-no-duplicate-selectors/index.js +++ b/lib/rules/keyframe-block-no-duplicate-selectors/index.js @@ -41,7 +41,8 @@ const rule = (primary) => { if (isDuplicate) { report({ - message: messages.rejected(selector), + message: messages.rejected, + messageArgs: [selector], node: keyframeRule, result, ruleName, diff --git a/lib/rules/keyframe-selector-notation/README.md b/lib/rules/keyframe-selector-notation/README.md index ea8796c450..47042c8a4d 100644 --- a/lib/rules/keyframe-selector-notation/README.md +++ b/lib/rules/keyframe-selector-notation/README.md @@ -13,6 +13,8 @@ The keyword `from` is equivalent to the value `0%`. The keyword `to` is equivale The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"keyword"|"percentage"|"percentage-unless-within-keyword-only-block"` diff --git a/lib/rules/keyframe-selector-notation/index.js b/lib/rules/keyframe-selector-notation/index.js index 9854e40eec..b951379a90 100644 --- a/lib/rules/keyframe-selector-notation/index.js +++ b/lib/rules/keyframe-selector-notation/index.js @@ -117,7 +117,8 @@ const rule = (primary, _, context) => { } report({ - message: messages.expected(selector, fixedSelector), + message: messages.expected, + messageArgs: [selector, fixedSelector], node: keyframeRule, result, ruleName, diff --git a/lib/rules/max-nesting-depth/README.md b/lib/rules/max-nesting-depth/README.md index b7df0379bc..1ddb413b80 100644 --- a/lib/rules/max-nesting-depth/README.md +++ b/lib/rules/max-nesting-depth/README.md @@ -47,6 +47,8 @@ a { This rule integrates into Stylelint's core the functionality of the (now deprecated) plugin [`stylelint-statement-max-nesting-depth`](https://github.com/davidtheclark/stylelint-statement-max-nesting-depth). +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum nesting depth allowed. diff --git a/lib/rules/max-nesting-depth/index.js b/lib/rules/max-nesting-depth/index.js index b2b96cb8a7..d33df14b07 100644 --- a/lib/rules/max-nesting-depth/index.js +++ b/lib/rules/max-nesting-depth/index.js @@ -75,7 +75,8 @@ const rule = (primary, secondaryOptions) => { ruleName, result, node: statement, - message: messages.expected(primary), + message: messages.expected, + messageArgs: [primary], }); } } diff --git a/lib/rules/media-feature-name-allowed-list/README.md b/lib/rules/media-feature-name-allowed-list/README.md index 528618216f..35198d997e 100644 --- a/lib/rules/media-feature-name-allowed-list/README.md +++ b/lib/rules/media-feature-name-allowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of allowed media feature names. * This media feature name */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", "unprefixed", /media-features/, "regex"]|"media-feature"|"/regex/"|/regex/` diff --git a/lib/rules/media-feature-name-allowed-list/index.js b/lib/rules/media-feature-name-allowed-list/index.js index f62558e95b..20963fadab 100644 --- a/lib/rules/media-feature-name-allowed-list/index.js +++ b/lib/rules/media-feature-name-allowed-list/index.js @@ -66,7 +66,8 @@ const rule = (primary) => { report({ index, endIndex, - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: atRule, ruleName, result, diff --git a/lib/rules/media-feature-name-disallowed-list/README.md b/lib/rules/media-feature-name-disallowed-list/README.md index 7256cca72d..f1a774f7ea 100644 --- a/lib/rules/media-feature-name-disallowed-list/README.md +++ b/lib/rules/media-feature-name-disallowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of disallowed media feature names. * This media feature name */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", "unprefixed", /media-features/, "regex"]|"media-feature"|"/regex/"|/regex/` diff --git a/lib/rules/media-feature-name-disallowed-list/index.js b/lib/rules/media-feature-name-disallowed-list/index.js index 7a0337504d..1b7fb87e37 100644 --- a/lib/rules/media-feature-name-disallowed-list/index.js +++ b/lib/rules/media-feature-name-disallowed-list/index.js @@ -66,7 +66,8 @@ const rule = (primary) => { report({ index, endIndex, - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: atRule, ruleName, result, diff --git a/lib/rules/media-feature-name-no-unknown/README.md b/lib/rules/media-feature-name-no-unknown/README.md index db21182f70..d8627529fc 100644 --- a/lib/rules/media-feature-name-no-unknown/README.md +++ b/lib/rules/media-feature-name-no-unknown/README.md @@ -13,6 +13,8 @@ This rule considers media feature names defined in the CSS Specifications, up to This rule ignores vendor-prefixed media feature names. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/media-feature-name-no-unknown/index.js b/lib/rules/media-feature-name-no-unknown/index.js index 5d8450f64b..5483742a0d 100644 --- a/lib/rules/media-feature-name-no-unknown/index.js +++ b/lib/rules/media-feature-name-no-unknown/index.js @@ -80,7 +80,8 @@ const rule = (primary, secondaryOptions) => { report({ index, endIndex, - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: atRule, ruleName, result, diff --git a/lib/rules/media-feature-name-value-allowed-list/README.md b/lib/rules/media-feature-name-value-allowed-list/README.md index 80f0316c23..842406b08e 100644 --- a/lib/rules/media-feature-name-value-allowed-list/README.md +++ b/lib/rules/media-feature-name-value-allowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of allowed media feature name and value pairs. * These features and values */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `object`: `{ "unprefixed-media-feature-name": ["array", "of", "values", "/regex/", /regex/]|"value"|"/regex/"|/regex/ }` diff --git a/lib/rules/media-feature-name-value-allowed-list/index.js b/lib/rules/media-feature-name-value-allowed-list/index.js index 151c31d0b5..d00a7d6fb7 100644 --- a/lib/rules/media-feature-name-value-allowed-list/index.js +++ b/lib/rules/media-feature-name-value-allowed-list/index.js @@ -90,7 +90,8 @@ const rule = (primary) => { report({ index, endIndex, - message: messages.rejected(mediaFeatureName, value), + message: messages.rejected, + messageArgs: [mediaFeatureName, value], node: atRule, ruleName, result, diff --git a/lib/rules/media-feature-range-notation/README.md b/lib/rules/media-feature-range-notation/README.md index 22d24495b5..82ed33721e 100644 --- a/lib/rules/media-feature-range-notation/README.md +++ b/lib/rules/media-feature-range-notation/README.md @@ -13,6 +13,8 @@ Media features of the range type can be written using prefixes or the more moder Because `min-` and `max-` both equate to range comparisons that include the value, they may be [limiting in certain situations](https://drafts.csswg.org/mediaqueries/#mq-min-max). +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"context"|"prefix"` diff --git a/lib/rules/media-feature-range-notation/index.js b/lib/rules/media-feature-range-notation/index.js index 2eb233000d..e87916983b 100644 --- a/lib/rules/media-feature-range-notation/index.js +++ b/lib/rules/media-feature-range-notation/index.js @@ -48,7 +48,8 @@ const rule = (primary) => { const endIndex = index + parent.value.length; report({ - message: messages.expected(primary), + message: messages.expected, + messageArgs: [primary], node: atRule, index, endIndex, diff --git a/lib/rules/no-descending-specificity/README.md b/lib/rules/no-descending-specificity/README.md index 1a62407603..db404d419e 100644 --- a/lib/rules/no-descending-specificity/README.md +++ b/lib/rules/no-descending-specificity/README.md @@ -17,6 +17,8 @@ This rule enforces that practice _as best it can_, reporting fewer errors than i We recommend turning this rule off if you use a lot of nesting. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## How it works **This rule looks at the last _compound selector_ in every full selector, and then compares it with other selectors in the stylesheet that end in the same way.** diff --git a/lib/rules/no-descending-specificity/index.js b/lib/rules/no-descending-specificity/index.js index 373073eb8e..ac4a639913 100644 --- a/lib/rules/no-descending-specificity/index.js +++ b/lib/rules/no-descending-specificity/index.js @@ -122,7 +122,8 @@ const rule = (primary, secondaryOptions) => { ruleName, result, node: ruleNode, - message: messages.rejected(selector, priorEntry.selector), + message: messages.rejected, + messageArgs: [selector, priorEntry.selector], word: selector, }); } diff --git a/lib/rules/no-duplicate-at-import-rules/README.md b/lib/rules/no-duplicate-at-import-rules/README.md index c7b4490709..07a738af7b 100644 --- a/lib/rules/no-duplicate-at-import-rules/README.md +++ b/lib/rules/no-duplicate-at-import-rules/README.md @@ -10,6 +10,8 @@ Disallow duplicate `@import` rules. * These are duplicates */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/no-duplicate-at-import-rules/index.js b/lib/rules/no-duplicate-at-import-rules/index.js index 7c8bcd5eb6..37057eb95c 100644 --- a/lib/rules/no-duplicate-at-import-rules/index.js +++ b/lib/rules/no-duplicate-at-import-rules/index.js @@ -53,7 +53,8 @@ const rule = (primary) => { if (isDuplicate) { report({ - message: messages.rejected(uri), + message: messages.rejected, + messageArgs: [uri], node: atRule, result, ruleName, diff --git a/lib/rules/no-duplicate-selectors/README.md b/lib/rules/no-duplicate-selectors/README.md index 9d58911f48..1745374a4d 100644 --- a/lib/rules/no-duplicate-selectors/README.md +++ b/lib/rules/no-duplicate-selectors/README.md @@ -22,6 +22,8 @@ The same selector _is_ allowed to repeat in the following circumstances: This rule resolves nested selectors. So `a b {} a { & b {} }` counts as a problem, because the resolved selectors end up with a duplicate. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/no-duplicate-selectors/index.js b/lib/rules/no-duplicate-selectors/index.js index cb34c4f32d..a5c8694ad8 100644 --- a/lib/rules/no-duplicate-selectors/index.js +++ b/lib/rules/no-duplicate-selectors/index.js @@ -115,7 +115,8 @@ const rule = (primary, secondaryOptions) => { result, ruleName, node: ruleNode, - message: messages.rejected(selectorForMessage, previousDuplicatePosition), + message: messages.rejected, + messageArgs: [selectorForMessage, previousDuplicatePosition], word: selectorForMessage, }); } @@ -136,7 +137,8 @@ const rule = (primary, secondaryOptions) => { result, ruleName, node: ruleNode, - message: messages.rejected(selector, selectorLine), + message: messages.rejected, + messageArgs: [selector, selectorLine], word: selector, }); reportedSelectors.add(normalized); diff --git a/lib/rules/no-unknown-animations/README.md b/lib/rules/no-unknown-animations/README.md index 8c9557560b..c36cdba6ef 100644 --- a/lib/rules/no-unknown-animations/README.md +++ b/lib/rules/no-unknown-animations/README.md @@ -15,6 +15,8 @@ a { animation: fancy-slide 2s linear; } This rule considers the identifiers of `@keyframes` rules defined within the same source to be known. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/no-unknown-animations/index.js b/lib/rules/no-unknown-animations/index.js index 293b631a10..fe5995c1b2 100644 --- a/lib/rules/no-unknown-animations/index.js +++ b/lib/rules/no-unknown-animations/index.js @@ -54,7 +54,8 @@ const rule = (primary) => { report({ result, ruleName, - message: messages.rejected(animationNameNode.value), + message: messages.rejected, + messageArgs: [animationNameNode.value], node: decl, index: begin + animationNameNode.sourceIndex, endIndex: begin + animationNameNode.sourceEndIndex, diff --git a/lib/rules/number-max-precision/README.md b/lib/rules/number-max-precision/README.md index 4e2146e253..2c1cf45659 100644 --- a/lib/rules/number-max-precision/README.md +++ b/lib/rules/number-max-precision/README.md @@ -9,6 +9,8 @@ a { top: 3.245634px; } * This decimal place */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum number of decimal places allowed. diff --git a/lib/rules/number-max-precision/index.js b/lib/rules/number-max-precision/index.js index f33e207469..ed48707c8f 100644 --- a/lib/rules/number-max-precision/index.js +++ b/lib/rules/number-max-precision/index.js @@ -108,7 +108,8 @@ const rule = (primary, secondaryOptions) => { node, index: baseIndex + valueNode.sourceIndex + match.index, word: actual.toString(), - message: messages.expected(actual, actual.toFixed(primary)), + message: messages.expected, + messageArgs: [actual, actual.toFixed(primary)], }); }); } diff --git a/lib/rules/property-allowed-list/README.md b/lib/rules/property-allowed-list/README.md index 8d853bf70e..116763c575 100644 --- a/lib/rules/property-allowed-list/README.md +++ b/lib/rules/property-allowed-list/README.md @@ -11,6 +11,8 @@ a { display: block; } This rule ignores variables (`$sass`, `@less`, `--custom-property`). +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", /properties/, "regex"]|"property"|"/regex/"|/regex/` diff --git a/lib/rules/property-allowed-list/index.js b/lib/rules/property-allowed-list/index.js index 8d554c7a58..c359483098 100644 --- a/lib/rules/property-allowed-list/index.js +++ b/lib/rules/property-allowed-list/index.js @@ -48,7 +48,8 @@ const rule = (primary) => { } report({ - message: messages.rejected(prop), + message: messages.rejected, + messageArgs: [prop], word: prop, node: decl, result, diff --git a/lib/rules/property-no-unknown/README.md b/lib/rules/property-no-unknown/README.md index 632b4f69f1..9d9569e6e4 100644 --- a/lib/rules/property-no-unknown/README.md +++ b/lib/rules/property-no-unknown/README.md @@ -18,6 +18,8 @@ This rule ignores: Use option `checkPrefixed` described below to turn on checking of vendor-prefixed properties. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/property-no-unknown/index.js b/lib/rules/property-no-unknown/index.js index 7579a95ad7..b6b05899e6 100644 --- a/lib/rules/property-no-unknown/index.js +++ b/lib/rules/property-no-unknown/index.js @@ -103,7 +103,8 @@ const rule = (primary, secondaryOptions) => { } report({ - message: messages.rejected(prop), + message: messages.rejected, + messageArgs: [prop], node: decl, result, ruleName, diff --git a/lib/rules/property-no-vendor-prefix/README.md b/lib/rules/property-no-vendor-prefix/README.md index defff863d0..46ed0e8fa4 100644 --- a/lib/rules/property-no-vendor-prefix/README.md +++ b/lib/rules/property-no-vendor-prefix/README.md @@ -13,6 +13,8 @@ This rule ignores non-standard vendor-prefixed properties that aren't handled by The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. However, it will not remove duplicate properties produced when the prefixes are removed. You can use [Autoprefixer](https://github.com/postcss/autoprefixer) itself, with the [`add` option off and the `remove` option on](https://github.com/postcss/autoprefixer#options), in these situations. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/property-no-vendor-prefix/index.js b/lib/rules/property-no-vendor-prefix/index.js index 8e513033f4..3e186ed7f3 100644 --- a/lib/rules/property-no-vendor-prefix/index.js +++ b/lib/rules/property-no-vendor-prefix/index.js @@ -66,7 +66,8 @@ const rule = (primary, secondaryOptions, context) => { } report({ - message: messages.rejected(prop), + message: messages.rejected, + messageArgs: [prop], word: prop, node: decl, result, diff --git a/lib/rules/rule-selector-property-disallowed-list/README.md b/lib/rules/rule-selector-property-disallowed-list/README.md index 5fc170da6a..a52c960de3 100644 --- a/lib/rules/rule-selector-property-disallowed-list/README.md +++ b/lib/rules/rule-selector-property-disallowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of disallowed properties for selectors within rules. * Selector and property name */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `object`: `{ "selector": ["array", "of", "properties", "/regex/", /regex/]|"property"|"/regex/"|/regex/` diff --git a/lib/rules/rule-selector-property-disallowed-list/__tests__/index.js b/lib/rules/rule-selector-property-disallowed-list/__tests__/index.js index ec1b1b5e82..c264830fe1 100644 --- a/lib/rules/rule-selector-property-disallowed-list/__tests__/index.js +++ b/lib/rules/rule-selector-property-disallowed-list/__tests__/index.js @@ -33,7 +33,7 @@ testRule({ reject: [ { code: 'a { color: red; }', - message: messages.rejected('color', 'a'), + message: messages.rejected('a', 'color'), line: 1, column: 5, endLine: 1, @@ -41,7 +41,7 @@ testRule({ }, { code: 'a { background: red; color: red; }', - message: messages.rejected('color', 'a'), + message: messages.rejected('a', 'color'), line: 1, column: 22, endLine: 1, @@ -49,7 +49,7 @@ testRule({ }, { code: 'a { margin-top: 0px; }', - message: messages.rejected('margin-top', 'a'), + message: messages.rejected('a', 'margin-top'), line: 1, column: 5, endLine: 1, @@ -59,14 +59,14 @@ testRule({ code: 'a { color: red; margin-top: 0px; }', warnings: [ { - message: messages.rejected('color', 'a'), + message: messages.rejected('a', 'color'), line: 1, column: 5, endLine: 1, endColumn: 10, }, { - message: messages.rejected('margin-top', 'a'), + message: messages.rejected('a', 'margin-top'), line: 1, column: 17, endLine: 1, @@ -76,7 +76,7 @@ testRule({ }, { code: '[data-foo] { font-size: 1rem; }', - message: messages.rejected('font-size', '[data-foo]'), + message: messages.rejected('[data-foo]', 'font-size'), line: 1, column: 14, endLine: 1, @@ -84,7 +84,7 @@ testRule({ }, { code: 'html[data-foo] { font-size: 1px; }', - message: messages.rejected('font-size', 'html[data-foo]'), + message: messages.rejected('html[data-foo]', 'font-size'), line: 1, column: 18, endLine: 1, diff --git a/lib/rules/rule-selector-property-disallowed-list/index.js b/lib/rules/rule-selector-property-disallowed-list/index.js index 06564dca5a..52125aaa24 100644 --- a/lib/rules/rule-selector-property-disallowed-list/index.js +++ b/lib/rules/rule-selector-property-disallowed-list/index.js @@ -11,7 +11,7 @@ const { isString, isRegExp } = require('../../utils/validateTypes'); const ruleName = 'rule-selector-property-disallowed-list'; const messages = ruleMessages(ruleName, { - rejected: (property, selector) => `Unexpected property "${property}" for selector "${selector}"`, + rejected: (selector, property) => `Unexpected property "${property}" for selector "${selector}"`, }); const meta = { @@ -56,7 +56,8 @@ const rule = (primary) => { if (matchesStringOrRegExp(prop, disallowedProperties)) { report({ - message: messages.rejected(prop, ruleNode.selector), + message: messages.rejected, + messageArgs: [ruleNode.selector, prop], node: decl, result, ruleName, diff --git a/lib/rules/selector-attribute-name-disallowed-list/README.md b/lib/rules/selector-attribute-name-disallowed-list/README.md index 11f5098453..8cc19db4c8 100644 --- a/lib/rules/selector-attribute-name-disallowed-list/README.md +++ b/lib/rules/selector-attribute-name-disallowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of disallowed attribute names. * This name */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", /names/, "regex"]|"name"|"/regex/"|/regex/` diff --git a/lib/rules/selector-attribute-name-disallowed-list/index.js b/lib/rules/selector-attribute-name-disallowed-list/index.js index 1d94c66407..590921accb 100644 --- a/lib/rules/selector-attribute-name-disallowed-list/index.js +++ b/lib/rules/selector-attribute-name-disallowed-list/index.js @@ -51,7 +51,8 @@ const rule = (primary) => { const endIndex = index + attributeName.length; report({ - message: messages.rejected(attributeName), + message: messages.rejected, + messageArgs: [attributeName], node: ruleNode, index, endIndex, diff --git a/lib/rules/selector-attribute-operator-allowed-list/README.md b/lib/rules/selector-attribute-operator-allowed-list/README.md index dbbac37c70..752add513e 100644 --- a/lib/rules/selector-attribute-operator-allowed-list/README.md +++ b/lib/rules/selector-attribute-operator-allowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of allowed attribute operators. * This operator */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string`: `["array", "of", "operators"]|"operator"` diff --git a/lib/rules/selector-attribute-operator-allowed-list/index.js b/lib/rules/selector-attribute-operator-allowed-list/index.js index d1a2a9f19b..3f7c177196 100644 --- a/lib/rules/selector-attribute-operator-allowed-list/index.js +++ b/lib/rules/selector-attribute-operator-allowed-list/index.js @@ -54,7 +54,8 @@ const rule = (primary) => { const endIndex = index + operator.length; report({ - message: messages.rejected(operator), + message: messages.rejected, + messageArgs: [operator], node: ruleNode, index, endIndex, diff --git a/lib/rules/selector-attribute-operator-disallowed-list/README.md b/lib/rules/selector-attribute-operator-disallowed-list/README.md index 2179d495c8..802bc040f9 100644 --- a/lib/rules/selector-attribute-operator-disallowed-list/README.md +++ b/lib/rules/selector-attribute-operator-disallowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of disallowed attribute operators. * This operator */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string`: `["array", "of", "operators"]|"operator"` diff --git a/lib/rules/selector-attribute-operator-disallowed-list/index.js b/lib/rules/selector-attribute-operator-disallowed-list/index.js index 6aa31bb761..c472ee33c0 100644 --- a/lib/rules/selector-attribute-operator-disallowed-list/index.js +++ b/lib/rules/selector-attribute-operator-disallowed-list/index.js @@ -54,7 +54,8 @@ const rule = (primary) => { const endIndex = index + operator.length; report({ - message: messages.rejected(operator), + message: messages.rejected, + messageArgs: [operator], node: ruleNode, index, endIndex, diff --git a/lib/rules/selector-combinator-allowed-list/README.md b/lib/rules/selector-combinator-allowed-list/README.md index 9b0caf4e91..46f5ceb5d0 100644 --- a/lib/rules/selector-combinator-allowed-list/README.md +++ b/lib/rules/selector-combinator-allowed-list/README.md @@ -13,6 +13,8 @@ This rule normalizes the whitespace descendant combinator to be a single space. This rule ignores [reference combinators](https://www.w3.org/TR/selectors4/#idref-combinators) e.g. `/for/`. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string`: `["array", "of", "combinators"]|"combinator"` diff --git a/lib/rules/selector-combinator-allowed-list/index.js b/lib/rules/selector-combinator-allowed-list/index.js index 5d3c178362..56d182630e 100644 --- a/lib/rules/selector-combinator-allowed-list/index.js +++ b/lib/rules/selector-combinator-allowed-list/index.js @@ -56,7 +56,8 @@ const rule = (primary) => { report({ result, ruleName, - message: messages.rejected(normalizedValue), + message: messages.rejected, + messageArgs: [normalizedValue], node: ruleNode, index, endIndex, diff --git a/lib/rules/selector-combinator-disallowed-list/README.md b/lib/rules/selector-combinator-disallowed-list/README.md index 3238ccf677..050ca5e0ee 100644 --- a/lib/rules/selector-combinator-disallowed-list/README.md +++ b/lib/rules/selector-combinator-disallowed-list/README.md @@ -13,6 +13,8 @@ This rule normalizes the whitespace descendant combinator to be a single space. This rule ignores [reference combinators](https://www.w3.org/TR/selectors4/#idref-combinators) e.g. `/for/`. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string`: `["array", "of", "combinators"]|"combinator"` diff --git a/lib/rules/selector-combinator-disallowed-list/index.js b/lib/rules/selector-combinator-disallowed-list/index.js index 8c6e6fc766..6a5dd87a58 100644 --- a/lib/rules/selector-combinator-disallowed-list/index.js +++ b/lib/rules/selector-combinator-disallowed-list/index.js @@ -56,7 +56,8 @@ const rule = (primary) => { report({ result, ruleName, - message: messages.rejected(normalizedValue), + message: messages.rejected, + messageArgs: [normalizedValue], node: ruleNode, index, endIndex, diff --git a/lib/rules/selector-disallowed-list/README.md b/lib/rules/selector-disallowed-list/README.md index 4cf479abd9..757baf76ef 100644 --- a/lib/rules/selector-disallowed-list/README.md +++ b/lib/rules/selector-disallowed-list/README.md @@ -9,6 +9,8 @@ Specify a list of disallowed selectors. * This is selector */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regexp`: `["array", "of", "selectors", /or/, "/regex/"]|"selector"|"/regex/"|/regex/` diff --git a/lib/rules/selector-disallowed-list/index.js b/lib/rules/selector-disallowed-list/index.js index 82b4213073..d71fa3285f 100644 --- a/lib/rules/selector-disallowed-list/index.js +++ b/lib/rules/selector-disallowed-list/index.js @@ -65,7 +65,8 @@ const rule = (primary, secondaryOptions) => { report({ result, ruleName, - message: messages.rejected(selector), + message: messages.rejected, + messageArgs: [selector], node: ruleNode, word: selector, }); @@ -80,7 +81,8 @@ const rule = (primary, secondaryOptions) => { report({ result, ruleName, - message: messages.rejected(selector), + message: messages.rejected, + messageArgs: [selector], node: ruleNode, word, }); diff --git a/lib/rules/selector-max-attribute/README.md b/lib/rules/selector-max-attribute/README.md index 3115188ce8..b71165e960 100644 --- a/lib/rules/selector-max-attribute/README.md +++ b/lib/rules/selector-max-attribute/README.md @@ -13,6 +13,8 @@ This rule resolves nested selectors before counting the number of attribute sele The `:not()` pseudo-class is also evaluated separately. The rule processes the argument as if it were an independent selector, and the result does not count toward the total for the entire selector. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum attribute selectors allowed. diff --git a/lib/rules/selector-max-attribute/index.js b/lib/rules/selector-max-attribute/index.js index 51e26293db..f38a23adb7 100644 --- a/lib/rules/selector-max-attribute/index.js +++ b/lib/rules/selector-max-attribute/index.js @@ -80,7 +80,8 @@ const rule = (primary, secondaryOptions) => { ruleName, result, node: ruleNode, - message: messages.expected(selector, primary), + message: messages.expected, + messageArgs: [selector, primary], word: selector, }); } diff --git a/lib/rules/selector-max-class/README.md b/lib/rules/selector-max-class/README.md index 4a1f626ca1..960f9183d6 100644 --- a/lib/rules/selector-max-class/README.md +++ b/lib/rules/selector-max-class/README.md @@ -14,6 +14,8 @@ This rule resolves nested selectors before counting the number of classes in a s The `:not()` pseudo-class is also evaluated separately. The rule processes the argument as if it were an independent selector, and the result does not count toward the total for the entire selector. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum classes allowed. diff --git a/lib/rules/selector-max-class/index.js b/lib/rules/selector-max-class/index.js index 8d8f1c2d08..d28717bd65 100644 --- a/lib/rules/selector-max-class/index.js +++ b/lib/rules/selector-max-class/index.js @@ -55,7 +55,8 @@ const rule = (primary) => { ruleName, result, node: ruleNode, - message: messages.expected(selector, primary), + message: messages.expected, + messageArgs: [selector, primary], word: selector, }); } diff --git a/lib/rules/selector-max-combinators/README.md b/lib/rules/selector-max-combinators/README.md index 46fbe69906..6c1486d387 100644 --- a/lib/rules/selector-max-combinators/README.md +++ b/lib/rules/selector-max-combinators/README.md @@ -11,6 +11,8 @@ Limit the number of combinators in a selector. This rule resolves nested selectors before counting the number of combinators selectors. Each selector in a [selector list](https://www.w3.org/TR/selectors4/#selector-list) is evaluated separately. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum combinators selectors allowed. diff --git a/lib/rules/selector-max-combinators/index.js b/lib/rules/selector-max-combinators/index.js index a4fee77719..cdbe284d75 100644 --- a/lib/rules/selector-max-combinators/index.js +++ b/lib/rules/selector-max-combinators/index.js @@ -56,7 +56,8 @@ const rule = (primary) => { ruleName, result, node: ruleNode, - message: messages.expected(selector, primary), + message: messages.expected, + messageArgs: [selector, primary], word: selector, }); } diff --git a/lib/rules/selector-max-compound-selectors/README.md b/lib/rules/selector-max-compound-selectors/README.md index 9e66f4f3fc..c3617dba56 100644 --- a/lib/rules/selector-max-compound-selectors/README.md +++ b/lib/rules/selector-max-compound-selectors/README.md @@ -16,6 +16,8 @@ This rule resolves nested selectors before counting the depth of a selector. Eac `:not()` is considered one compound selector irrespective to the complexity of the selector inside it. The rule _does_ process that inner selector, but does so separately, independent of the main selector. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum compound selectors allowed. diff --git a/lib/rules/selector-max-compound-selectors/index.js b/lib/rules/selector-max-compound-selectors/index.js index e57841664c..11316d09a1 100644 --- a/lib/rules/selector-max-compound-selectors/index.js +++ b/lib/rules/selector-max-compound-selectors/index.js @@ -66,7 +66,8 @@ const rule = (primary) => { ruleName, result, node: ruleNode, - message: messages.expected(selector, primary), + message: messages.expected, + messageArgs: [selector, primary], word: selector, }); } diff --git a/lib/rules/selector-max-id/README.md b/lib/rules/selector-max-id/README.md index 6cc71b6949..d3e6d4d142 100644 --- a/lib/rules/selector-max-id/README.md +++ b/lib/rules/selector-max-id/README.md @@ -13,6 +13,8 @@ This rule resolves nested selectors before counting the number of ID selectors. The `:not()` pseudo-class is also evaluated separately. The rule processes the argument as if it were an independent selector, and the result does not count toward the total for the entire selector. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum universal selectors allowed. diff --git a/lib/rules/selector-max-id/index.js b/lib/rules/selector-max-id/index.js index f82e8f1983..5ce1c4be38 100644 --- a/lib/rules/selector-max-id/index.js +++ b/lib/rules/selector-max-id/index.js @@ -72,7 +72,8 @@ const rule = (primary, secondaryOptions) => { ruleName, result, node: ruleNode, - message: messages.expected(selector, primary), + message: messages.expected, + messageArgs: [selector, primary], word: selector, }); } diff --git a/lib/rules/selector-max-pseudo-class/README.md b/lib/rules/selector-max-pseudo-class/README.md index 3b1c1ea49a..e9470e2303 100644 --- a/lib/rules/selector-max-pseudo-class/README.md +++ b/lib/rules/selector-max-pseudo-class/README.md @@ -14,6 +14,8 @@ This rule resolves nested selectors before counting the number of pseudo-classes The content of the `:not()` pseudo-class is also evaluated separately. The rule processes the argument as if it were an independent selector, and the result does not count toward the total for the entire selector. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum pseudo-classes allowed. diff --git a/lib/rules/selector-max-pseudo-class/index.js b/lib/rules/selector-max-pseudo-class/index.js index 8f6e12571b..b37836dcb5 100644 --- a/lib/rules/selector-max-pseudo-class/index.js +++ b/lib/rules/selector-max-pseudo-class/index.js @@ -67,7 +67,8 @@ const rule = (primary) => { ruleName, result, node: ruleNode, - message: messages.expected(selector, primary), + message: messages.expected, + messageArgs: [selector, primary], word: selector, }); } diff --git a/lib/rules/selector-max-specificity/README.md b/lib/rules/selector-max-specificity/README.md index 1f783952ee..18f13cb918 100755 --- a/lib/rules/selector-max-specificity/README.md +++ b/lib/rules/selector-max-specificity/README.md @@ -15,6 +15,8 @@ This rule ignores selectors with variable interpolation (`#{$var}`, `@{var}`, `$ This rule resolves nested selectors before counting the specificity of a selector. Each selector in a [selector list](https://www.w3.org/TR/selectors4/#selector-list) is evaluated separately. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: Maximum specificity allowed. diff --git a/lib/rules/selector-max-specificity/index.js b/lib/rules/selector-max-specificity/index.js index 2d8037a2e7..08b0eb12de 100644 --- a/lib/rules/selector-max-specificity/index.js +++ b/lib/rules/selector-max-specificity/index.js @@ -213,7 +213,8 @@ const rule = (primary, secondaryOptions) => { ruleName, result, node: ruleNode, - message: messages.expected(resolvedSelector, primary), + message: messages.expected, + messageArgs: [resolvedSelector, primary], word: selector, }); } diff --git a/lib/rules/selector-max-type/README.md b/lib/rules/selector-max-type/README.md index 610b554e4a..9c244e4aa1 100644 --- a/lib/rules/selector-max-type/README.md +++ b/lib/rules/selector-max-type/README.md @@ -13,6 +13,8 @@ This rule resolves nested selectors before counting the number of type selectors The `:not()` pseudo-class is also evaluated separately. The rule processes the argument as if it were an independent selector, and the result does not count toward the total for the entire selector. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum type selectors allowed. diff --git a/lib/rules/selector-max-type/index.js b/lib/rules/selector-max-type/index.js index e9c331c562..d84de41511 100644 --- a/lib/rules/selector-max-type/index.js +++ b/lib/rules/selector-max-type/index.js @@ -108,7 +108,8 @@ const rule = (primary, secondaryOptions) => { ruleName, result, node: ruleNode, - message: messages.expected(selector, primary), + message: messages.expected, + messageArgs: [selector, primary], word: selector, }); } diff --git a/lib/rules/selector-max-universal/README.md b/lib/rules/selector-max-universal/README.md index 5a387b7b44..2f4b0d48e3 100644 --- a/lib/rules/selector-max-universal/README.md +++ b/lib/rules/selector-max-universal/README.md @@ -13,6 +13,8 @@ This rule resolves nested selectors before counting the number of universal sele The logical combinations pseudo-class (e.g. `:not`, `:has`) is also evaluated separately. The rule processes the argument as if it were an independent selector, and the result does not count toward the total for the entire selector. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Maximum universal selectors allowed. diff --git a/lib/rules/selector-max-universal/index.js b/lib/rules/selector-max-universal/index.js index f96b0a52e2..14505df7c6 100644 --- a/lib/rules/selector-max-universal/index.js +++ b/lib/rules/selector-max-universal/index.js @@ -78,7 +78,8 @@ const rule = (primary, secondaryOptions) => { ruleName, result, node: ruleNode, - message: messages.expected(selector, primary), + message: messages.expected, + messageArgs: [selector, primary], word: selector, }); } diff --git a/lib/rules/selector-no-qualifying-type/README.md b/lib/rules/selector-no-qualifying-type/README.md index 77c53f083f..ce0126f895 100644 --- a/lib/rules/selector-no-qualifying-type/README.md +++ b/lib/rules/selector-no-qualifying-type/README.md @@ -11,6 +11,8 @@ Disallow qualifying a selector by type. A type selector is "qualifying" when it is compounded with (chained to) another selector (e.g. `a.foo`, `a#foo`). This rule does not regulate type selectors that are combined with other selectors via a combinator (e.g. `a > .foo`, `a #foo`). +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/selector-no-qualifying-type/index.js b/lib/rules/selector-no-qualifying-type/index.js index 05f08468ef..b4f8ec46e6 100644 --- a/lib/rules/selector-no-qualifying-type/index.js +++ b/lib/rules/selector-no-qualifying-type/index.js @@ -142,7 +142,8 @@ const rule = (primary, secondaryOptions) => { ruleName, result, node: ruleNode, - message: messages.rejected(selector), + message: messages.rejected, + messageArgs: [selector], word: selector, }); } diff --git a/lib/rules/selector-no-vendor-prefix/README.md b/lib/rules/selector-no-vendor-prefix/README.md index cf697833c0..e3a725fb98 100644 --- a/lib/rules/selector-no-vendor-prefix/README.md +++ b/lib/rules/selector-no-vendor-prefix/README.md @@ -13,6 +13,8 @@ This rule ignores non-standard vendor-prefixed selectors that aren't handled by The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. However, it will not remove duplicate selectors produced when the prefixes are removed. You can use [Autoprefixer](https://github.com/postcss/autoprefixer) itself, with the [`add` option off and the `remove` option on](https://github.com/postcss/autoprefixer#options), in these situations. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/selector-no-vendor-prefix/index.js b/lib/rules/selector-no-vendor-prefix/index.js index 4910d39815..ff8645d160 100644 --- a/lib/rules/selector-no-vendor-prefix/index.js +++ b/lib/rules/selector-no-vendor-prefix/index.js @@ -68,7 +68,8 @@ const rule = (primary, secondaryOptions, context) => { report({ result, ruleName, - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: ruleNode, word: value, }); diff --git a/lib/rules/selector-not-notation/README.md b/lib/rules/selector-not-notation/README.md index 43619ef117..b0da9b3bc1 100644 --- a/lib/rules/selector-not-notation/README.md +++ b/lib/rules/selector-not-notation/README.md @@ -18,6 +18,8 @@ Use: The [`fix` option](../../../docs/user-guide/options.md#fix) option can automatically fix most of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"simple"|"complex"` diff --git a/lib/rules/selector-not-notation/index.js b/lib/rules/selector-not-notation/index.js index 5d233e8d9c..655f365cdd 100644 --- a/lib/rules/selector-not-notation/index.js +++ b/lib/rules/selector-not-notation/index.js @@ -113,7 +113,8 @@ const rule = (primary, _, context) => { assert(pseudo.source && pseudo.source.end); report({ - message: messages.expected(primary), + message: messages.expected, + messageArgs: [primary], node: ruleNode, index: pseudo.sourceIndex, endIndex: pseudo.source.end.column, diff --git a/lib/rules/selector-pseudo-class-allowed-list/README.md b/lib/rules/selector-pseudo-class-allowed-list/README.md index cb5a3bdc19..f6199d3ab7 100644 --- a/lib/rules/selector-pseudo-class-allowed-list/README.md +++ b/lib/rules/selector-pseudo-class-allowed-list/README.md @@ -11,6 +11,8 @@ Specify a list of allowed pseudo-class selectors. This rule ignores selectors that use variable interpolation e.g. `:#{$variable} {}`. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", "unprefixed", /pseudo-classes/, "/regex/"]|"pseudo-class"|"/regex/"|/regex/` diff --git a/lib/rules/selector-pseudo-class-allowed-list/index.js b/lib/rules/selector-pseudo-class-allowed-list/index.js index 87432a6335..92cb6b9b6e 100644 --- a/lib/rules/selector-pseudo-class-allowed-list/index.js +++ b/lib/rules/selector-pseudo-class-allowed-list/index.js @@ -59,7 +59,8 @@ const rule = (primary) => { report({ word: value, - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: ruleNode, result, ruleName, diff --git a/lib/rules/selector-pseudo-class-disallowed-list/README.md b/lib/rules/selector-pseudo-class-disallowed-list/README.md index c3945579df..d8435ef120 100644 --- a/lib/rules/selector-pseudo-class-disallowed-list/README.md +++ b/lib/rules/selector-pseudo-class-disallowed-list/README.md @@ -11,6 +11,8 @@ Specify a list of disallowed pseudo-class selectors. This rule ignores selectors that use variable interpolation e.g. `:#{$variable} {}`. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", "unprefixed", /pseudo-classes/, "/regex/"]|"pseudo-class"|"/regex/"|/regex/` diff --git a/lib/rules/selector-pseudo-class-disallowed-list/index.js b/lib/rules/selector-pseudo-class-disallowed-list/index.js index f85a0e3e42..21b5a12a65 100644 --- a/lib/rules/selector-pseudo-class-disallowed-list/index.js +++ b/lib/rules/selector-pseudo-class-disallowed-list/index.js @@ -59,7 +59,8 @@ const rule = (primary) => { report({ word: value, - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: ruleNode, result, ruleName, diff --git a/lib/rules/selector-pseudo-class-no-unknown/README.md b/lib/rules/selector-pseudo-class-no-unknown/README.md index f264f4e2fb..d36e2e63ee 100644 --- a/lib/rules/selector-pseudo-class-no-unknown/README.md +++ b/lib/rules/selector-pseudo-class-no-unknown/README.md @@ -13,6 +13,8 @@ This rule considers pseudo-class selectors defined in the CSS Specifications, up This rule ignores vendor-prefixed pseudo-class selectors. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/selector-pseudo-class-no-unknown/index.js b/lib/rules/selector-pseudo-class-no-unknown/index.js index a1af00fd64..4cdd9700d5 100644 --- a/lib/rules/selector-pseudo-class-no-unknown/index.js +++ b/lib/rules/selector-pseudo-class-no-unknown/index.js @@ -119,7 +119,8 @@ const rule = (primary, secondaryOptions) => { } report({ - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node, index, ruleName, diff --git a/lib/rules/selector-pseudo-element-allowed-list/README.md b/lib/rules/selector-pseudo-element-allowed-list/README.md index 6455ac49eb..0198b8f7e7 100644 --- a/lib/rules/selector-pseudo-element-allowed-list/README.md +++ b/lib/rules/selector-pseudo-element-allowed-list/README.md @@ -14,6 +14,8 @@ This rule ignores: - CSS2 pseudo-elements i.e. those prefixed with a single colon - selectors that use variable interpolation e.g. `::#{$variable} {}` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", "unprefixed", /pseudo-elements/, "/regex/"]|"pseudo-element"|"/regex/"|/regex/` diff --git a/lib/rules/selector-pseudo-element-allowed-list/index.js b/lib/rules/selector-pseudo-element-allowed-list/index.js index e6352a5e3f..db4c02c4f4 100644 --- a/lib/rules/selector-pseudo-element-allowed-list/index.js +++ b/lib/rules/selector-pseudo-element-allowed-list/index.js @@ -59,7 +59,8 @@ const rule = (primary) => { report({ index: pseudoNode.sourceIndex, - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: ruleNode, word: value, result, diff --git a/lib/rules/selector-pseudo-element-disallowed-list/README.md b/lib/rules/selector-pseudo-element-disallowed-list/README.md index f9d5bfa063..53ea0920f7 100644 --- a/lib/rules/selector-pseudo-element-disallowed-list/README.md +++ b/lib/rules/selector-pseudo-element-disallowed-list/README.md @@ -14,6 +14,8 @@ This rule ignores: - CSS2 pseudo-elements i.e. those prefixed with a single colon - selectors that use variable interpolation e.g. `::#{$variable} {}` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string|regex`: `["array", "of", "unprefixed", /pseudo-elements/, "/regex/"]|"pseudo-element"|"/regex/"|/regex/` diff --git a/lib/rules/selector-pseudo-element-disallowed-list/index.js b/lib/rules/selector-pseudo-element-disallowed-list/index.js index 52bbd3beba..59d7968528 100644 --- a/lib/rules/selector-pseudo-element-disallowed-list/index.js +++ b/lib/rules/selector-pseudo-element-disallowed-list/index.js @@ -59,7 +59,8 @@ const rule = (primary) => { report({ index: pseudoNode.sourceIndex, - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: ruleNode, word: value, result, diff --git a/lib/rules/selector-pseudo-element-no-unknown/README.md b/lib/rules/selector-pseudo-element-no-unknown/README.md index fcebc0db17..410e3c5ed6 100644 --- a/lib/rules/selector-pseudo-element-no-unknown/README.md +++ b/lib/rules/selector-pseudo-element-no-unknown/README.md @@ -13,6 +13,8 @@ This rule considers pseudo-element selectors defined in the CSS Specifications, This rule ignores vendor-prefixed pseudo-element selectors. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/selector-pseudo-element-no-unknown/index.js b/lib/rules/selector-pseudo-element-no-unknown/index.js index f72085c900..1ba479919a 100644 --- a/lib/rules/selector-pseudo-element-no-unknown/index.js +++ b/lib/rules/selector-pseudo-element-no-unknown/index.js @@ -78,7 +78,8 @@ const rule = (primary, secondaryOptions) => { } report({ - message: messages.rejected(value), + message: messages.rejected, + messageArgs: [value], node: ruleNode, index: pseudoNode.sourceIndex, ruleName, diff --git a/lib/rules/selector-type-case/README.md b/lib/rules/selector-type-case/README.md index 309ac05a29..30b3ef5289 100644 --- a/lib/rules/selector-type-case/README.md +++ b/lib/rules/selector-type-case/README.md @@ -11,6 +11,8 @@ Specify lowercase or uppercase for type selectors. The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"lower"|"upper"` diff --git a/lib/rules/selector-type-case/index.js b/lib/rules/selector-type-case/index.js index 37fd98eb54..c2fae483d6 100644 --- a/lib/rules/selector-type-case/index.js +++ b/lib/rules/selector-type-case/index.js @@ -104,7 +104,8 @@ const rule = (primary, secondaryOptions, context) => { } report({ - message: messages.expected(value, expectedValue), + message: messages.expected, + messageArgs: [value, expectedValue], node: ruleNode, index: sourceIndex, ruleName, diff --git a/lib/rules/selector-type-no-unknown/README.md b/lib/rules/selector-type-no-unknown/README.md index 129929c454..554d91c734 100644 --- a/lib/rules/selector-type-no-unknown/README.md +++ b/lib/rules/selector-type-no-unknown/README.md @@ -11,6 +11,8 @@ Disallow unknown type selectors. This rule considers tags defined in the HTML, SVG, and MathML specifications to be known. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/selector-type-no-unknown/index.js b/lib/rules/selector-type-no-unknown/index.js index 5dc7e3711b..6f29bb862c 100644 --- a/lib/rules/selector-type-no-unknown/index.js +++ b/lib/rules/selector-type-no-unknown/index.js @@ -99,7 +99,8 @@ const rule = (primary, secondaryOptions) => { } report({ - message: messages.rejected(tagName), + message: messages.rejected, + messageArgs: [tagName], node: ruleNode, index: tagNode.sourceIndex, ruleName, diff --git a/lib/rules/shorthand-property-no-redundant-values/README.md b/lib/rules/shorthand-property-no-redundant-values/README.md index 2f8661bda6..7d638998e3 100644 --- a/lib/rules/shorthand-property-no-redundant-values/README.md +++ b/lib/rules/shorthand-property-no-redundant-values/README.md @@ -25,6 +25,8 @@ This rule checks the following shorthand properties: The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/shorthand-property-no-redundant-values/index.js b/lib/rules/shorthand-property-no-redundant-values/index.js index ba02e4cea8..c7b4880189 100644 --- a/lib/rules/shorthand-property-no-redundant-values/index.js +++ b/lib/rules/shorthand-property-no-redundant-values/index.js @@ -167,7 +167,8 @@ const rule = (primary, _secondaryOptions, context) => { decl.value = decl.value.replace(value, shortestFormString); } else { report({ - message: messages.rejected(value, shortestFormString), + message: messages.rejected, + messageArgs: [value, shortestFormString], node: decl, result, ruleName, diff --git a/lib/rules/time-min-milliseconds/README.md b/lib/rules/time-min-milliseconds/README.md index 841a56578f..13ff274910 100644 --- a/lib/rules/time-min-milliseconds/README.md +++ b/lib/rules/time-min-milliseconds/README.md @@ -11,6 +11,8 @@ a { animation: slip-n-slide 150ms linear; } This rule checks positive numbers in `transition-duration`, `transition-delay`, `animation-duration`, `animation-delay`, and those times as they manifest in the `transition` and `animation` shorthands. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `int`: Minimum number of milliseconds for time values. diff --git a/lib/rules/time-min-milliseconds/index.js b/lib/rules/time-min-milliseconds/index.js index a8757f8d48..4a73b4f40c 100644 --- a/lib/rules/time-min-milliseconds/index.js +++ b/lib/rules/time-min-milliseconds/index.js @@ -147,7 +147,8 @@ const rule = (primary, secondaryOptions) => { report({ result, ruleName, - message: messages.expected(minimum), + message: messages.expected, + messageArgs: [minimum], index, endIndex, node: decl, diff --git a/lib/rules/unit-allowed-list/README.md b/lib/rules/unit-allowed-list/README.md index 5be8ee308d..0bc5da72b2 100644 --- a/lib/rules/unit-allowed-list/README.md +++ b/lib/rules/unit-allowed-list/README.md @@ -9,6 +9,8 @@ a { width: 100px; } * These units */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string`: `["array", "of", "units"]|"unit"` diff --git a/lib/rules/unit-allowed-list/index.js b/lib/rules/unit-allowed-list/index.js index 472f09d2d0..a516a02710 100644 --- a/lib/rules/unit-allowed-list/index.js +++ b/lib/rules/unit-allowed-list/index.js @@ -91,7 +91,8 @@ const rule = (primary, secondaryOptions) => { report({ index: index + valueNode.sourceIndex + number.length, endIndex: index + valueNode.sourceEndIndex, - message: messages.rejected(unit), + message: messages.rejected, + messageArgs: [unit], node, result, ruleName, diff --git a/lib/rules/unit-disallowed-list/README.md b/lib/rules/unit-disallowed-list/README.md index db982b1128..abff2114f3 100644 --- a/lib/rules/unit-disallowed-list/README.md +++ b/lib/rules/unit-disallowed-list/README.md @@ -9,6 +9,8 @@ a { width: 100px; } * These units */ ``` +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `array|string`: `["array", "of", "units"]|"unit"` diff --git a/lib/rules/unit-disallowed-list/index.js b/lib/rules/unit-disallowed-list/index.js index 1fec70874d..276d5fea88 100644 --- a/lib/rules/unit-disallowed-list/index.js +++ b/lib/rules/unit-disallowed-list/index.js @@ -88,7 +88,8 @@ const rule = (primary, secondaryOptions) => { report({ index: nodeIndex + valueNode.sourceIndex + number.length, endIndex: nodeIndex + valueNode.sourceEndIndex, - message: messages.rejected(unit), + message: messages.rejected, + messageArgs: [unit], node, result, ruleName, diff --git a/lib/rules/unit-no-unknown/README.md b/lib/rules/unit-no-unknown/README.md index 775408ac71..c708810d32 100644 --- a/lib/rules/unit-no-unknown/README.md +++ b/lib/rules/unit-no-unknown/README.md @@ -11,6 +11,8 @@ a { width: 100pixels; } This rule considers units defined in the CSS Specifications, up to and including Editor's Drafts, to be known. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/unit-no-unknown/index.js b/lib/rules/unit-no-unknown/index.js index 470524cf9f..fa53587b4c 100644 --- a/lib/rules/unit-no-unknown/index.js +++ b/lib/rules/unit-no-unknown/index.js @@ -141,7 +141,8 @@ const rule = (primary, secondaryOptions) => { report({ index: index + valueNode.sourceIndex + number.length, endIndex: index + valueNode.sourceEndIndex, - message: messages.rejected(unit), + message: messages.rejected, + messageArgs: [unit], node, result, ruleName, diff --git a/lib/rules/value-keyword-case/README.md b/lib/rules/value-keyword-case/README.md index e66b10c136..4a59c52e5f 100644 --- a/lib/rules/value-keyword-case/README.md +++ b/lib/rules/value-keyword-case/README.md @@ -13,6 +13,8 @@ This rule ignores [``](https://developer.mozilla.org/en/docs/Web/ The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options `string`: `"lower"|"upper"` diff --git a/lib/rules/value-keyword-case/index.js b/lib/rules/value-keyword-case/index.js index 285907a339..818b8cf6f2 100644 --- a/lib/rules/value-keyword-case/index.js +++ b/lib/rules/value-keyword-case/index.js @@ -224,7 +224,8 @@ const rule = (primary, secondaryOptions, context) => { } report({ - message: messages.expected(keyword, expectedKeyword), + message: messages.expected, + messageArgs: [keyword, expectedKeyword], node: decl, index: declarationValueIndex(decl) + node.sourceIndex, result, diff --git a/lib/rules/value-no-vendor-prefix/README.md b/lib/rules/value-no-vendor-prefix/README.md index e0094c9b60..721a7a0acd 100644 --- a/lib/rules/value-no-vendor-prefix/README.md +++ b/lib/rules/value-no-vendor-prefix/README.md @@ -13,6 +13,8 @@ This rule ignores non-standard vendor-prefixed values that aren't handled by [Au The [`fix` option](../../../docs/user-guide/options.md#fix) can automatically fix all of the problems reported by this rule. However, it will not remove duplicate values produced when the prefixes are removed. You can use [Autoprefixer](https://github.com/postcss/autoprefixer) itself, with the [`add` option off and the `remove` option on](https://github.com/postcss/autoprefixer#options), in these situations. +The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule. + ## Options ### `true` diff --git a/lib/rules/value-no-vendor-prefix/index.js b/lib/rules/value-no-vendor-prefix/index.js index cac62c6b29..e17e0e7cfe 100644 --- a/lib/rules/value-no-vendor-prefix/index.js +++ b/lib/rules/value-no-vendor-prefix/index.js @@ -91,7 +91,8 @@ const rule = (primary, secondaryOptions, context) => { const startIndex = decl.prop.length + (decl.raws.between || '').length + node.sourceIndex; report({ - message: messages.rejected(node.value), + message: messages.rejected, + messageArgs: [node.value], node: decl, index: startIndex, endIndex: startIndex + node.value.length, From 47b5e3747d0e6b199286a7e1e7dc655c9bb4f041 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:41:56 +0000 Subject: [PATCH 2/3] Bump @types/css-tree from 2.0.1 to 2.3.0 (#6655) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> --- .../index.js | 2 ++ package-lock.json | 14 +++++------ package.json | 2 +- patches/@types+css-tree+2.0.1.patch | 23 ------------------- 4 files changed, 10 insertions(+), 31 deletions(-) delete mode 100644 patches/@types+css-tree+2.0.1.patch diff --git a/lib/rules/declaration-property-value-no-unknown/index.js b/lib/rules/declaration-property-value-no-unknown/index.js index 0f8902b32f..2eea048829 100644 --- a/lib/rules/declaration-property-value-no-unknown/index.js +++ b/lib/rules/declaration-property-value-no-unknown/index.js @@ -112,6 +112,8 @@ const rule = (primary, secondaryOptions) => { if (!error) return; + if (!('mismatchLength' in error)) return; + const { mismatchLength, mismatchOffset, name, rawMessage } = error; if (name !== 'SyntaxMatchError') return; diff --git a/package-lock.json b/package-lock.json index 5f855eec9c..b471f5895e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -61,7 +61,7 @@ "@stylelint/prettier-config": "^2.0.0", "@stylelint/remark-preset": "^4.0.0", "@types/balanced-match": "^1.0.2", - "@types/css-tree": "^2.0.1", + "@types/css-tree": "^2.3.0", "@types/debug": "^4.1.7", "@types/file-entry-cache": "^5.0.2", "@types/global-modules": "^2.0.0", @@ -2283,9 +2283,9 @@ } }, "node_modules/@types/css-tree": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/css-tree/-/css-tree-2.0.1.tgz", - "integrity": "sha512-eeRN9rsZK/ZD5nmJCeZXxyTwq+gsvN1EljeCPEyXk+vLOAwsgpsrdXio4lPBzxAuhIKu3MK7QvZxWUw9xDX8Bg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@types/css-tree/-/css-tree-2.3.0.tgz", + "integrity": "sha512-waFpSayOepEo9vI68r5K/hAgxloFDkUTqXvYduSnwzS5n+tdmvouIWBJy+kOq5xwh0paoJw7NnNXiM8O/O9jRg==", "dev": true }, "node_modules/@types/debug": { @@ -15938,9 +15938,9 @@ } }, "@types/css-tree": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@types/css-tree/-/css-tree-2.0.1.tgz", - "integrity": "sha512-eeRN9rsZK/ZD5nmJCeZXxyTwq+gsvN1EljeCPEyXk+vLOAwsgpsrdXio4lPBzxAuhIKu3MK7QvZxWUw9xDX8Bg==", + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@types/css-tree/-/css-tree-2.3.0.tgz", + "integrity": "sha512-waFpSayOepEo9vI68r5K/hAgxloFDkUTqXvYduSnwzS5n+tdmvouIWBJy+kOq5xwh0paoJw7NnNXiM8O/O9jRg==", "dev": true }, "@types/debug": { diff --git a/package.json b/package.json index b4f4bd69cd..4203a2b20e 100644 --- a/package.json +++ b/package.json @@ -160,7 +160,7 @@ "@stylelint/prettier-config": "^2.0.0", "@stylelint/remark-preset": "^4.0.0", "@types/balanced-match": "^1.0.2", - "@types/css-tree": "^2.0.1", + "@types/css-tree": "^2.3.0", "@types/debug": "^4.1.7", "@types/file-entry-cache": "^5.0.2", "@types/global-modules": "^2.0.0", diff --git a/patches/@types+css-tree+2.0.1.patch b/patches/@types+css-tree+2.0.1.patch deleted file mode 100644 index 7c7c0910ee..0000000000 --- a/patches/@types+css-tree+2.0.1.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff --git a/node_modules/@types/css-tree/index.d.ts b/node_modules/@types/css-tree/index.d.ts -index 2e4ed18..7f096c6 100755 ---- a/node_modules/@types/css-tree/index.d.ts -+++ b/node_modules/@types/css-tree/index.d.ts -@@ -830,3 +830,18 @@ export const url: { - decode(input: string): string; - encode(input: string): string; - }; -+ -+type MatchResult = { -+ error?: { -+ mismatchLength: number; -+ mismatchOffset: number; -+ name: string; -+ rawMessage: string; -+ }; -+}; -+ -+declare class Lexer { -+ matchProperty(propertyName: string, value: CssNode | string): MatchResult; -+} -+ -+export function fork(extension: Record>): { lexer: Lexer }; From 38591f21e4974b456c1b7b67727b0a6eb32a1a88 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 14 Feb 2023 11:42:37 +0000 Subject: [PATCH 3/3] Bump eslint-config-stylelint from 17.1.0 to 18.0.0 (#6656) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Masafumi Koba <473530+ybiquitous@users.noreply.github.com> --- package-lock.json | 162 ++++++++++++++++++++++++---------------------- package.json | 6 +- 2 files changed, 89 insertions(+), 79 deletions(-) diff --git a/package-lock.json b/package-lock.json index b471f5895e..b28730a423 100644 --- a/package-lock.json +++ b/package-lock.json @@ -78,7 +78,8 @@ "common-tags": "^1.8.2", "deepmerge": "^4.3.0", "eslint": "^8.34.0", - "eslint-config-stylelint": "^17.1.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", "husky": "^8.0.3", "jest": "^29.4.2", "jest-preset-stylelint": "^6.0.0", @@ -2585,13 +2586,13 @@ "dev": true }, "node_modules/@typescript-eslint/scope-manager": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.45.0.tgz", - "integrity": "sha512-noDMjr87Arp/PuVrtvN3dXiJstQR1+XlQ4R1EvzG+NMgXi8CuMCXpb8JqNtFHKceVSQ985BZhfRdowJzbv4yKw==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.51.0.tgz", + "integrity": "sha512-gNpxRdlx5qw3yaHA0SFuTjW4rxeYhpHxt491PEcKF8Z6zpq0kMhe0Tolxt0qjlojS+/wArSDlj/LtE69xUJphQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/visitor-keys": "5.45.0" + "@typescript-eslint/types": "5.51.0", + "@typescript-eslint/visitor-keys": "5.51.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2602,9 +2603,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.45.0.tgz", - "integrity": "sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.51.0.tgz", + "integrity": "sha512-SqOn0ANn/v6hFn0kjvLwiDi4AzR++CBZz0NV5AnusT2/3y32jdc0G4woXPWHCumWtUXZKPAS27/9vziSsC9jnw==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -2615,13 +2616,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.0.tgz", - "integrity": "sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.51.0.tgz", + "integrity": "sha512-TSkNupHvNRkoH9FMA3w7TazVFcBPveAAmb7Sz+kArY6sLT86PA5Vx80cKlYmd8m3Ha2SwofM1KwraF24lM9FvA==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/visitor-keys": "5.45.0", + "@typescript-eslint/types": "5.51.0", + "@typescript-eslint/visitor-keys": "5.51.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -2642,16 +2643,16 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.45.0.tgz", - "integrity": "sha512-OUg2JvsVI1oIee/SwiejTot2OxwU8a7UfTFMOdlhD2y+Hl6memUSL4s98bpUTo8EpVEr0lmwlU7JSu/p2QpSvA==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.51.0.tgz", + "integrity": "sha512-76qs+5KWcaatmwtwsDJvBk4H76RJQBFe+Gext0EfJdC3Vd2kpY2Pf//OHHzHp84Ciw0/rYoGTDnIAr3uWhhJYw==", "dev": true, "dependencies": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.45.0", - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/typescript-estree": "5.45.0", + "@typescript-eslint/scope-manager": "5.51.0", + "@typescript-eslint/types": "5.51.0", + "@typescript-eslint/typescript-estree": "5.51.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -2696,12 +2697,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.0.tgz", - "integrity": "sha512-jc6Eccbn2RtQPr1s7th6jJWQHBHI6GBVQkCHoJFQ5UreaKm59Vxw+ynQUPPY2u2Amquc+7tmEoC2G52ApsGNNg==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.51.0.tgz", + "integrity": "sha512-Oh2+eTdjHjOFjKA27sxESlA87YPSOJafGCR0md5oeMdh1ZcCfAGCIOL216uTBAkAIptvLIfKQhl7lHxMJet4GQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "5.45.0", + "@typescript-eslint/types": "5.51.0", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -4349,9 +4350,9 @@ } }, "node_modules/eslint-config-prettier": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", - "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", "dev": true, "bin": { "eslint-config-prettier": "bin/cli.js" @@ -4361,15 +4362,23 @@ } }, "node_modules/eslint-config-stylelint": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-stylelint/-/eslint-config-stylelint-17.1.0.tgz", - "integrity": "sha512-W4wVdtIUdgjNpIAdWtFtsxuxCu7uSe+2WuTerH923UW800+B0FbO+9uk0ZFFvu9+MYdLyQ+RYU8GLjl9ZnCm8g==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-stylelint/-/eslint-config-stylelint-18.0.0.tgz", + "integrity": "sha512-oWiHn/Ep7lfsixeuI82eQbZpPNd6Pv0JvZQTNbH4nVVcYPRxnm3uVz5uBPThK1n8b2iDgU7FsiPUvNWbw1Qc7w==", "dev": true, "dependencies": { - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-jest": "^27.1.6", + "eslint-config-prettier": "^8.6.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-regexp": "^1.11.0" + "eslint-plugin-regexp": "^1.12.0" + }, + "peerDependencies": { + "eslint": ">= 8.33.0", + "eslint-plugin-jest": ">= 27.2.0" + }, + "peerDependenciesMeta": { + "eslint-plugin-jest": { + "optional": true + } } }, "node_modules/eslint-plugin-es": { @@ -4416,9 +4425,9 @@ } }, "node_modules/eslint-plugin-jest": { - "version": "27.1.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.1.6.tgz", - "integrity": "sha512-XA7RFLSrlQF9IGtAmhddkUkBuICCTuryfOTfCSWcZHiHb69OilIH05oozH2XA6CEOtztnOd0vgXyvxZodkxGjg==", + "version": "27.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.2.1.tgz", + "integrity": "sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==", "dev": true, "dependencies": { "@typescript-eslint/utils": "^5.10.0" @@ -4493,9 +4502,9 @@ } }, "node_modules/eslint-plugin-regexp": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-1.11.0.tgz", - "integrity": "sha512-xSFARZrg0LMIp6g7XXUByS52w0fBp3lucoDi347BbeN9XqkGNFdsN+nDzNZIJbJJ1tWB08h3Pd8RfA5p7Kezhg==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-1.12.0.tgz", + "integrity": "sha512-A1lnzOqHC22Ve8PZJgcw5pDHk5Sxp7J/pY86u027lVEGpUwe7dhZVVsy3SCm/cN438Zts8e9c09KGIVK4IixuA==", "dev": true, "dependencies": { "comment-parser": "^1.1.2", @@ -16240,29 +16249,29 @@ "dev": true }, "@typescript-eslint/scope-manager": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.45.0.tgz", - "integrity": "sha512-noDMjr87Arp/PuVrtvN3dXiJstQR1+XlQ4R1EvzG+NMgXi8CuMCXpb8JqNtFHKceVSQ985BZhfRdowJzbv4yKw==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.51.0.tgz", + "integrity": "sha512-gNpxRdlx5qw3yaHA0SFuTjW4rxeYhpHxt491PEcKF8Z6zpq0kMhe0Tolxt0qjlojS+/wArSDlj/LtE69xUJphQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/visitor-keys": "5.45.0" + "@typescript-eslint/types": "5.51.0", + "@typescript-eslint/visitor-keys": "5.51.0" } }, "@typescript-eslint/types": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.45.0.tgz", - "integrity": "sha512-QQij+u/vgskA66azc9dCmx+rev79PzX8uDHpsqSjEFtfF2gBUTRCpvYMh2gw2ghkJabNkPlSUCimsyBEQZd1DA==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.51.0.tgz", + "integrity": "sha512-SqOn0ANn/v6hFn0kjvLwiDi4AzR++CBZz0NV5AnusT2/3y32jdc0G4woXPWHCumWtUXZKPAS27/9vziSsC9jnw==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.45.0.tgz", - "integrity": "sha512-maRhLGSzqUpFcZgXxg1qc/+H0bT36lHK4APhp0AEUVrpSwXiRAomm/JGjSG+kNUio5kAa3uekCYu/47cnGn5EQ==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.51.0.tgz", + "integrity": "sha512-TSkNupHvNRkoH9FMA3w7TazVFcBPveAAmb7Sz+kArY6sLT86PA5Vx80cKlYmd8m3Ha2SwofM1KwraF24lM9FvA==", "dev": true, "requires": { - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/visitor-keys": "5.45.0", + "@typescript-eslint/types": "5.51.0", + "@typescript-eslint/visitor-keys": "5.51.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -16271,16 +16280,16 @@ } }, "@typescript-eslint/utils": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.45.0.tgz", - "integrity": "sha512-OUg2JvsVI1oIee/SwiejTot2OxwU8a7UfTFMOdlhD2y+Hl6memUSL4s98bpUTo8EpVEr0lmwlU7JSu/p2QpSvA==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.51.0.tgz", + "integrity": "sha512-76qs+5KWcaatmwtwsDJvBk4H76RJQBFe+Gext0EfJdC3Vd2kpY2Pf//OHHzHp84Ciw0/rYoGTDnIAr3uWhhJYw==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", "@types/semver": "^7.3.12", - "@typescript-eslint/scope-manager": "5.45.0", - "@typescript-eslint/types": "5.45.0", - "@typescript-eslint/typescript-estree": "5.45.0", + "@typescript-eslint/scope-manager": "5.51.0", + "@typescript-eslint/types": "5.51.0", + "@typescript-eslint/typescript-estree": "5.51.0", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0", "semver": "^7.3.7" @@ -16311,12 +16320,12 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.45.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.45.0.tgz", - "integrity": "sha512-jc6Eccbn2RtQPr1s7th6jJWQHBHI6GBVQkCHoJFQ5UreaKm59Vxw+ynQUPPY2u2Amquc+7tmEoC2G52ApsGNNg==", + "version": "5.51.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.51.0.tgz", + "integrity": "sha512-Oh2+eTdjHjOFjKA27sxESlA87YPSOJafGCR0md5oeMdh1ZcCfAGCIOL216uTBAkAIptvLIfKQhl7lHxMJet4GQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.45.0", + "@typescript-eslint/types": "5.51.0", "eslint-visitor-keys": "^3.3.0" } }, @@ -17563,22 +17572,21 @@ } }, "eslint-config-prettier": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.5.0.tgz", - "integrity": "sha512-obmWKLUNCnhtQRKc+tmnYuQl0pFU1ibYJQ5BGhTVB08bHe9wC8qUeG7c08dj9XX+AuPj1YSGSQIHl1pnDHZR0Q==", + "version": "8.6.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz", + "integrity": "sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA==", "dev": true, "requires": {} }, "eslint-config-stylelint": { - "version": "17.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-stylelint/-/eslint-config-stylelint-17.1.0.tgz", - "integrity": "sha512-W4wVdtIUdgjNpIAdWtFtsxuxCu7uSe+2WuTerH923UW800+B0FbO+9uk0ZFFvu9+MYdLyQ+RYU8GLjl9ZnCm8g==", + "version": "18.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-stylelint/-/eslint-config-stylelint-18.0.0.tgz", + "integrity": "sha512-oWiHn/Ep7lfsixeuI82eQbZpPNd6Pv0JvZQTNbH4nVVcYPRxnm3uVz5uBPThK1n8b2iDgU7FsiPUvNWbw1Qc7w==", "dev": true, "requires": { - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-jest": "^27.1.6", + "eslint-config-prettier": "^8.6.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-regexp": "^1.11.0" + "eslint-plugin-regexp": "^1.12.0" } }, "eslint-plugin-es": { @@ -17609,9 +17617,9 @@ } }, "eslint-plugin-jest": { - "version": "27.1.6", - "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.1.6.tgz", - "integrity": "sha512-XA7RFLSrlQF9IGtAmhddkUkBuICCTuryfOTfCSWcZHiHb69OilIH05oozH2XA6CEOtztnOd0vgXyvxZodkxGjg==", + "version": "27.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-27.2.1.tgz", + "integrity": "sha512-l067Uxx7ZT8cO9NJuf+eJHvt6bqJyz2Z29wykyEdz/OtmcELQl2MQGQLX8J94O1cSJWAwUSEvCjwjA7KEK3Hmg==", "dev": true, "requires": { "@typescript-eslint/utils": "^5.10.0" @@ -17655,9 +17663,9 @@ } }, "eslint-plugin-regexp": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-1.11.0.tgz", - "integrity": "sha512-xSFARZrg0LMIp6g7XXUByS52w0fBp3lucoDi347BbeN9XqkGNFdsN+nDzNZIJbJJ1tWB08h3Pd8RfA5p7Kezhg==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-regexp/-/eslint-plugin-regexp-1.12.0.tgz", + "integrity": "sha512-A1lnzOqHC22Ve8PZJgcw5pDHk5Sxp7J/pY86u027lVEGpUwe7dhZVVsy3SCm/cN438Zts8e9c09KGIVK4IixuA==", "dev": true, "requires": { "comment-parser": "^1.1.2", diff --git a/package.json b/package.json index 4203a2b20e..4a90f1a024 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,8 @@ "prettier": "@stylelint/prettier-config", "eslintConfig": { "extends": [ - "stylelint" + "stylelint", + "stylelint/jest" ], "globals": { "__dirname": true, @@ -177,7 +178,8 @@ "common-tags": "^1.8.2", "deepmerge": "^4.3.0", "eslint": "^8.34.0", - "eslint-config-stylelint": "^17.1.0", + "eslint-config-stylelint": "^18.0.0", + "eslint-plugin-jest": "^27.2.1", "husky": "^8.0.3", "jest": "^29.4.2", "jest-preset-stylelint": "^6.0.0",