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-value-disallowed-list #6453

Closed
glen-84 opened this issue Nov 6, 2022 · 1 comment · Fixed by #6463
Closed

Add message arguments to declaration-property-value-disallowed-list #6453

glen-84 opened this issue Nov 6, 2022 · 1 comment · Fixed by #6463
Labels
status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules

Comments

@glen-84
Copy link
Contributor

glen-84 commented Nov 6, 2022

What is the problem you're trying to solve?

#4117 has been closed without a solution for declaration-property-value-disallowed-list. I'd still like to be able to specify a custom message per disallowed property value.

What solution would you like to see?

"declaration-property-value-disallowed-list": [
    {
        "line-height": ["normal"]
    },
    {
        message: (propertyName, _propertyValues) => {
            switch (propertyName) {
                case "line-height":
                    return "Avoid setting line-height to 'normal', as the value depends on the user agent";
            }
        }
    }
]
@ybiquitous ybiquitous added the status: ready to implement is ready to be worked on by someone label Nov 7, 2022
@ybiquitous
Copy link
Member

@glen-84 Thanks for the proposal. In PR #6312, we've started supporting just-needed rules since we were not confident in the feature.

So, if there are needs, we can easily increase supported rules by passing messageArgs to report() like this (see also #6391):

report({
message: messages.rejected,
messageArgs: [node.value],


I've labeled the issue as ready to implement. Please consider contributing if you have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: ready to implement is ready to be worked on by someone type: enhancement a new feature that isn't related to rules
Development

Successfully merging a pull request may close this issue.

2 participants