Skip to content

fix: correctly extract baseline support for CSS functions#401

Merged
DMartens merged 1 commit into
eslint:mainfrom
xbinaryx:css-function-baseline-support
Mar 24, 2026
Merged

fix: correctly extract baseline support for CSS functions#401
DMartens merged 1 commit into
eslint:mainfrom
xbinaryx:css-function-baseline-support

Conversation

@xbinaryx

@xbinaryx xbinaryx commented Mar 19, 2026

Copy link
Copy Markdown
Contributor

Prerequisites checklist

AI acknowledgment

  • I did not use AI to generate this PR.
  • (If the above is not checked) I have reviewed the AI-generated content before submitting.

What did you do?

a {
	background-image: image("foo.png", red);
}

What did you expect to happen?

use-baseline should report image() as a non-baseline CSS function.

What actually happened?

No lint error was reported for image().

What is the purpose of this pull request?

This PR fixes CSS function baseline extraction in the generator.

The previous logic would treat CSS data types as CSS functions when reading css.types.* compat keys. In practice, that meant image() could fail to report correctly because css.types.image (<image>) was being conflated with the image() function.

What changes did you make? (Give an overview)

Refactored function extraction so CSS functions are handled explicitly, regenerated baseline-data.js, and added regression coverage.

Related Issues

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

https://developer.mozilla.org/en-US/docs/Web/CSS/Reference/Values/image/image

@eslint-github-bot eslint-github-bot Bot added the bug Something isn't working label Mar 19, 2026
@github-project-automation github-project-automation Bot moved this to Needs Triage in Triage Mar 19, 2026
@DMartens

Copy link
Copy Markdown

Thank you for spotting this.
In the future please split up the PR in the fix and refactor as combining them makes it harder to review.
How did you determine that only image and color are affected?
For example I tried sibling-index which is also non-baseline but use-baseline does not report it.

@xbinaryx

Copy link
Copy Markdown
Contributor Author

In the future please split up the PR in the fix and refactor as combining them makes it harder to review.

Yeah sorry about that. I had to refactor first to avoid making the code uglier with this fix.

How did you determine that only image and color are affected?

They’re the direct bare css.types.<name> collisions I identified.

For example I tried sibling-index which is also non-baseline but use-baseline does not report it.

sibling-index() is part of a broader gap here, same as sibling-count(), shape(), progress(), if(), etc. Those exist in web-features, but not in mdn-data.css.functions, so use-baseline doesn’t currently recognize/report them.

This should be addressed by the mdn-data -> @webref/css migration in #376, which I’m working on.

@nzakas nzakas moved this from Needs Triage to Implementing in Triage Mar 23, 2026

@nzakas nzakas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM. Would like @DMartens to verify before merging.

@nzakas nzakas moved this from Implementing to Second Review Needed in Triage Mar 23, 2026
@nzakas nzakas added the accepted There is consensus among the team that this change meets the criteria for inclusion label Mar 23, 2026

@DMartens DMartens left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Changes LGTM, thanks.

@DMartens DMartens merged commit a1b5c6f into eslint:main Mar 24, 2026
33 checks passed
@github-project-automation github-project-automation Bot moved this from Second Review Needed to Complete in Triage Mar 24, 2026
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.

4 participants