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

Add message arguments to declaration-property-unit-allowed-list #6570

Merged
merged 2 commits into from Jan 9, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/perfect-suits-unite.md
@@ -0,0 +1,5 @@
---
"stylelint": minor
---

Added message arguments to `declaration-property-unit-allowed-list`
mattxwang marked this conversation as resolved.
Show resolved Hide resolved
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