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

feat(biome_css_analyzer): noUnknownFunction #2570

Merged
merged 14 commits into from
Apr 29, 2024

Conversation

neoki07
Copy link
Contributor

@neoki07 neoki07 commented Apr 23, 2024

Summary

close #2530
Implement function-no-unknown

Test Plan

added tests and snapshots

@github-actions github-actions bot added A-Project Area: project L-CSS Language: CSS A-Diagnostic Area: diagnostocis labels Apr 23, 2024
@neoki07 neoki07 marked this pull request as ready for review April 24, 2024 10:31
"hwb",
"hypot",
"image",
"image-rect",

Choose a reason for hiding this comment

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

You can remove this one, -o-image-rect, -ms-image-rect, -o-image-rect and -webkit-image-rect.
It's the only non-prefixed function name which is bogus AFAIK.
Keep-moz-image-rect though.

https://caniuse.com/mdn-css_properties_background-image_image-rect
https://bugs.webkit.org/show_bug.cgi?id=32177

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed them.


/// List of known CSS value functions sourced from [`css-functions-list`](https://www.npmjs.com/package/css-functions-list).
/// See the original list [here](https://github.com/niksy/css-functions-list/blob/master/index.json).
pub const FUNCTION_KEYWORDS: [&str; 671] = [
Copy link
Member

Choose a reason for hiding this comment

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

These are ordered entries. We should use binary_search instead of contains (it's faster).

Although, entries must be ordered. So we should add some tests for that. We do the same with other constants

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have sorted the entries and updated the code to use binary_search instead of contains.

Copy link

codspeed-hq bot commented Apr 26, 2024

CodSpeed Performance Report

Merging #2570 will not alter performance

Comparing neokidev:feat/function-no-unknown (f8961bc) with main (1e1f56d)

Summary

✅ 90 untouched benchmarks

@github-actions github-actions bot added the A-CLI Area: CLI label Apr 26, 2024
@neoki07
Copy link
Contributor Author

neoki07 commented Apr 26, 2024

I apologize for the confusion. I accidentally pushed changes to the biome_cli files, which caused the A-CLI label to be added to the PR...

Copy link
Contributor

@togami2864 togami2864 left a comment

Choose a reason for hiding this comment

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

Looks good. Could you rebase?

@togami2864 togami2864 merged commit 46c378e into biomejs:main Apr 29, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-CLI Area: CLI A-Diagnostic Area: diagnostocis A-Project Area: project L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Implement function-no-unknown
4 participants