Repository navigation
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
font_family_without_font_faceno longer reportsrevert-layeras a missing font family.GENERIC_FAMILIESlists the CSS-wide keywordsinherit,initial,unsetandrevert, but notrevert-layer, the fifth one (CSS Cascade 5, supported in every current browser). A rule likeis valid CSS that rolls the family back to the previous cascade layer, yet the linter reports it as an error: "Font family used without @font-face declaration: revert-layer".
Why
The finding is an error-severity false positive, and its fix hint (add an
@font-faceforrevert-layer) cannot be followed.Related work
None found (searched issues and PRs for
revert-layer).How
Add
"revert-layer"next to"revert"inGENERIC_FAMILIES, so it is skipped like the other CSS-wide keywords.Test plan
packages/lint/src/rules/fonts.test.ts.fonts.test.tspasses (58 tests); the rest ofsrc/rules/has the same results with and without the change.fails without the fix:
packages/lint/src/rules/fonts.test.ts› "does not flag the revert-layer keyword" (onefont_family_without_font_facefinding instead of none)This PR was prepared with AI assistance; I reviewed the change and ran the tests.