Skip to content

Conversation

@thecalamiity
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request?

This pull request fixes an inaccurate error message in the use-baseline rule. Previously, CSS functions (such as light-dark() and color-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)

  • Renamed the exported baseline data key from typesfunctions.
  • Updated the use-baseline rule to:
    • Use functions instead of types.
    • Replace the message ID notBaselineType with notBaselineFunction.
    • Update the corresponding error message to use “Function” instead of “Type.”
  • Updated the baseline data generation script to export functions consistently.
  • Adjusted all affected test cases to match the new message ID and terminology.

Related Issues

Fixes #293

Is there anything you'd like reviewers to focus on?

Copy link
Contributor

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

@Pixel998 Pixel998 added the accepted There is consensus among the team that this change meets the criteria for inclusion label Oct 13, 2025
@Pixel998 Pixel998 moved this from Needs Triage to Second Review Needed in Triage Oct 13, 2025
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")});
Copy link
Member

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.

Copy link
Contributor Author

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.

if (!(`${type}()` in mdnData.css.functions)) {
continue;
}

Copy link
Member

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

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

@nzakas nzakas merged commit cc0dff7 into eslint:main Oct 21, 2025
22 checks passed
@github-project-automation github-project-automation bot moved this from Second Review Needed to Complete in Triage Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

accepted There is consensus among the team that this change meets the criteria for inclusion bug Something isn't working contributor pool

Projects

Status: Complete

Development

Successfully merging this pull request may close these issues.

Rule Change: Incorrect error message for CSS functions in use-baseline rule

3 participants