-
-
Notifications
You must be signed in to change notification settings - Fork 32
fix: correct message for functions in use-baseline rule
#297
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: correct message for functions in use-baseline rule
#297
Conversation
Pixel998
left a comment
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, thanks! Leaving open for a second review before merging.
| export const atRules = new Map(${JSON.stringify(Object.entries(cssFeatures.atRules), null, "\t")}); | ||
| export const mediaConditions = new Map(${JSON.stringify(Object.entries(cssFeatures.mediaConditions), null, "\t")}); | ||
| export const types = new Map(${JSON.stringify(Object.entries(cssFeatures.types), null, "\t")}); | ||
| export const functions = new Map(${JSON.stringify(Object.entries(cssFeatures.functions), null, "\t")}); |
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.
I don't think this is the correct approach here. Let's keep types as-is and just add functions.
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.
The "types" here are actually just functions. We're filtering the css.types.* entries through mdnData.css.functions to extract only the ones that represent actual CSS functions.
css/tools/generate-baseline.js
Lines 158 to 160 in c6c5b9d
| if (!(`${type}()` in mdnData.css.functions)) { | |
| continue; | |
| } |
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.
Ah gotcha, thanks for explaining. 👍
nzakas
left a comment
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. Thanks!
Prerequisites checklist
What is the purpose of this pull request?
This pull request fixes an inaccurate error message in the
use-baselinerule. Previously, CSS functions (such aslight-dark()andcolor-mix()) were reported as “types,” which was misleading. The rule will now correctly refer to them as “functions.”What changes did you make? (Give an overview)
types→functions.use-baselinerule to:functionsinstead oftypes.notBaselineTypewithnotBaselineFunction.functionsconsistently.Related Issues
Fixes #293
Is there anything you'd like reviewers to focus on?