Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Increase experimental messageArgs support #6463

Merged
merged 7 commits into from Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/several-cucumbers-wonder.md
@@ -0,0 +1,5 @@
---
"stylelint": minor
---

Added: custom message formatting for `at-rule-disallowed-list`, `declaration-property-unit-disallowed-list`, `declaration-property-value-disallowed-list`, `function-disallowed-list`, and `property-disallowed-list`
2 changes: 2 additions & 0 deletions lib/rules/at-rule-disallowed-list/README.md
Expand Up @@ -9,6 +9,8 @@ Specify a list of disallowed 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"`
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/at-rule-disallowed-list/index.js
Expand Up @@ -43,7 +43,8 @@ const rule = (primary) => {
}

report({
message: messages.rejected(name),
message: messages.rejected,
messageArgs: [name],
node: atRule,
result,
ruleName,
Expand Down
2 changes: 2 additions & 0 deletions lib/rules/declaration-property-unit-disallowed-list/README.md
Expand Up @@ -9,6 +9,8 @@ a { width: 100px; }
* These properties and these units */
```

The [`message` secondary option](../../../docs/user-guide/configure.md#message) can accept the arguments of this rule.

## Options

`object`: `{ "unprefixed-property-name": ["array", "of", "units"]|"unit" }`
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/declaration-property-unit-disallowed-list/index.js
Expand Up @@ -75,7 +75,8 @@ const rule = (primary) => {
const endIndex = index + node.value.length;

report({
message: messages.rejected(prop, unit),
message: messages.rejected,
messageArgs: [prop, unit],
node: decl,
index,
endIndex,
Expand Down
Expand Up @@ -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/ }`
Expand Down
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/rules/function-disallowed-list/README.md
Expand Up @@ -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/`
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/function-disallowed-list/index.js
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions lib/rules/property-disallowed-list/README.md
Expand Up @@ -9,6 +9,8 @@ a { text-rendering: optimizeLegibility; }
* This 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/`
Expand Down
3 changes: 2 additions & 1 deletion lib/rules/property-disallowed-list/index.js
Expand Up @@ -48,7 +48,8 @@ const rule = (primary) => {
}

report({
message: messages.rejected(prop),
message: messages.rejected,
messageArgs: [prop],
word: prop,
node: decl,
result,
Expand Down