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
Fix false positives for variables in font-family-no-missing-generic-family-keyword #4806
Conversation
This introduces a second parse loop through a font-family. To avoid this, we could add an parameter to findFontFamily which dictates whether to include variables in the result, but the function would need to blindly include variables, without sanity checking them (like whether a variable represents a number or something). Fixes stylelint#4765
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this looks good to me, and it passes the test case mentioned in the spec.
Would like to get other opinions before giving the go-ahead to merge - like on the discussion point on the second parse loop, or if there are any other test cases we should consider.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, LGTM!
Yes, this introduces a second parse loop through a font-family.
I think this is fine as splitting on spaces is going to be quick.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Updated changelog:
|
# By Mike Allanson (6) and others # Via GitHub * master: Bump @types/lodash from 4.14.152 to 4.14.154 (#4817) Update CHANGELOG.md Fix with workaround a TypeError thrown for "html" (#4797) Update CHANGELOG.md Fix false positives for variables in font-family-no-missing-generic-family-keyword (#4806) Update CHANGELOG.md Add ignoreSelectors option to block-opening-brace-space-before (#4640) Update CHANGELOG.md Fix error message percentage/number precision for alpha-value-notation (#4802) Create new 'createPartialStylelintResult' module (#4815) Move function normalizeAllRuleSettings() out to a separate module (#4810)
Fixes #4765
Yes, this introduces a second parse loop through a font-family.
To avoid this, we could add an parameter to findFontFamily which
dictates whether to include variables in the result, but the function
would need to blindly include variables, without sanity checking them
(like whether a variable represents a number or something).