fix: allow CSS-wide keywords in font-family-fallbacks#391
fix: allow CSS-wide keywords in font-family-fallbacks#391sethamus wants to merge 2 commits intoeslint:mainfrom
Conversation
Tanujkanti4441
left a comment
There was a problem hiding this comment.
Thanks for the PR, looks good, just a suggestion regarding docs.
| "fangsong", | ||
| ]); | ||
|
|
||
| const cssWideKeywords = new Set([ |
There was a problem hiding this comment.
Should we use sourceCode.lexer.cssWideKeywordsSyntax.map instead of this set?
This would allow users to fork the syntax and add css-wide keyword.
There was a problem hiding this comment.
What’s the motivating use case for extending cssWideKeywords?
There was a problem hiding this comment.
I think this is a good idea for maintenance purposes. It gives us one less spot to update should things change.
There was a problem hiding this comment.
I think we should use lexer.cssWideKeywords here instead of cssWideKeywordsSyntax. This does currently cause a TypeScript error, so I’ve opened eslint/csstree#128 to update the typings.
Prerequisites checklist
AI acknowledgment
What is the purpose of this pull request?
This PR fixes false positives in
css/font-family-fallbacksby allowing CSS-wide keywords (e.g.inherit,initial,unset,revert,revert-layer) forfont-family/font, since they shouldn’t be required to include fallback/generic fonts.What changes did you make? (Give an overview)
var()values).font-familyand shorthandfontCSS-wide keyword cases.Related Issues
Fixes #387
Is there anything you'd like reviewers to focus on?