feat: Add support for media conditions in require-baseline rule#49
Conversation
nzakas
left a comment
There was a problem hiding this comment.
Thanks for the submission, this is looking really good. Just left one note about an edge case.
| continue; | ||
| } | ||
|
|
||
| const conditionLevel = mediaConditions.get(child.name); |
There was a problem hiding this comment.
conditionLevel can be undefined if someone is using an unknown media condition. In that case, we should just exit early because no-invalid-at-rules should catch it.
There was a problem hiding this comment.
Good point! I've fixed it.
Add check for invalid at-rules
| node, | ||
| ) { | ||
| for (const child of node.children) { | ||
| // ignore unknown media conditions - no-invalid-at-rules already catches this |
There was a problem hiding this comment.
Can you also a add a test that has an invalid media condition to verify that it's ignored?
There was a problem hiding this comment.
I've added.
test: ignore unknown media conditions
|
@ryo-manba we'd like to pay you for this contribution, but I couldn't find an email address to contact you. Please send an email to contact (at) eslint (dot) org. |
|
@nzakas |
Prerequisites checklist
What is the purpose of this pull request?
This pull request adds support for media conditions in the
require-baselinerule.What changes did you make? (Give an overview)
@mediaqueries.baseline-data.jsto include media conditions.Related Issues
fixes #48
Is there anything you'd like reviewers to focus on?