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 media-feature-name-value-no-unknown
#6560
Comments
@mattxwang Thanks for opening the issue! |
That sounds promising. It'd be aligned with the proposed Let's see where #6511 goes first before taking this issue further. |
media-feature-no-invalid-range
media-feature-name-value-no-unknown
It would be relatively straightforward with our media query parser to check if a media query is syntactically valid or not. Types of errors :
I think
|
@romainmenke Thanks for the reminder. Your suggestion sounds great to me. 👍🏼 Could you please redraw this new rule's blueprint? |
I've made some edits to the blueprints |
Thank you! I've labeled the issue as ready to implement. Please consider contributing if you have time. There are steps on how to add a new rule in the Developer guide. |
I've got a first working draft of the new rule ready here : #6906 (comment) I don't expect anyone to review this at this time, but if someone is curious or has early feedback, that is always welcome 🙇 I tried to focus only on value validation and I am ignoring all other types of errors. Some other types of errors I thought of while writing this rule:
Technically these are also errors related to values and names but I think these are more related to the general grammar. i.e. wrong location of a value or missing value. Only when the following is true does the rule kick in:
|
What is the problem you're trying to solve?
In the discussion for #6550, @romainmenke mentioned certain types of issues involving invalid media query ranges. Their examples include:
I could also see the potential for auditing queries with the wrong number or types or arguments, ex:
I'm not sure if this is an appropriate rule for Stylelint, especially given its potential complexity.
What solution would you like to see?
media-feature-name-value-no-unknown
true
Unexpected unknown value "${value}" for media feature "${name}"
The text was updated successfully, but these errors were encountered: