Skip to content

Commit

Permalink
Add message arguments to declaration-property-unit-allowed-list (#6570
Browse files Browse the repository at this point in the history
)

Closes #6454.
  • Loading branch information
mattxwang committed Jan 9, 2023
1 parent 5e6d46a commit b4fd2d5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/perfect-suits-unite.md
@@ -0,0 +1,5 @@
---
"stylelint": minor
---

Added: message arguments to `declaration-property-unit-allowed-list`
2 changes: 2 additions & 0 deletions lib/rules/declaration-property-unit-allowed-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-allowed-list/index.js
Expand Up @@ -93,7 +93,8 @@ const rule = (primary, secondaryOptions) => {
const endIndex = index + node.value.length;

report({
message: messages.rejected(prop, unit),
message: messages.rejected,
messageArgs: [prop, unit],
node: decl,
index,
endIndex,
Expand Down

0 comments on commit b4fd2d5

Please sign in to comment.