Skip to content
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

Merged
merged 1 commit into from Jun 2, 2020

Conversation

srawlins
Copy link
Contributor

Which issue, if any, is this issue related to?

Fixes #4765

Is there anything in the PR that needs further explanation?

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).

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
Copy link
Member

@mattxwang mattxwang left a 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.

Copy link
Member

@jeddy3 jeddy3 left a 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.

@jeddy3 jeddy3 changed the title font-family-no-missing-generic-family-keyword: allow variables Fix false positives for variables in font-family-no-missing-generic-family-keyword May 31, 2020
Copy link
Member

@mattxwang mattxwang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@m-allanson m-allanson merged commit 35cb8e7 into stylelint:master Jun 2, 2020
@m-allanson
Copy link
Member

Updated changelog:

  • Fixed: font-family-no-missing-generic-family-keyword false positives for variables (#4806)

m-allanson added a commit that referenced this pull request Jun 3, 2020
# 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)
ybiquitous added a commit that referenced this pull request Apr 12, 2021
…by default

This change aims to ignore any variables (e.g. `var()`, `$var`, `@var` etc.) by default
for the `font-family-no-missing-generic-family-keyword` rule.

Fix #4765 (retry of #4806)
ybiquitous added a commit that referenced this pull request Apr 12, 2021
This change aims to ignore any variables (e.g. `var()`, `$var`, `@var` etc.)
for the `font-family-no-missing-generic-family-keyword` rule.

Fix #4765 (retry of #4806)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Fix false positives for variables in font-family-no-missing-generic-family-keyword
4 participants