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(linter): implement noDuplicateProperties #4029

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

togami2864
Copy link
Contributor

@togami2864 togami2864 commented Sep 21, 2024

Summary

closes #2784

Test Plan

Added tests and snapshots

@togami2864 togami2864 self-assigned this Sep 21, 2024
@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-CSS Language: CSS A-Diagnostic Area: diagnostocis labels Sep 21, 2024
Copy link

codspeed-hq bot commented Sep 21, 2024

CodSpeed Performance Report

Merging #4029 will degrade performances by 19.13%

Comparing togami2864:2784 (b1ea322) with main (2035efe)

Summary

⚡ 1 improvements
❌ 4 regressions
✅ 102 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main togami2864:2784 Change
css_analyzer[bootstrap_18416142857265205439.css] 255.9 ms 304.3 ms -15.92%
css_analyzer[bulma_5641719244145477318.css] 784.5 ms 911.6 ms -13.94%
css_analyzer[foundation_11602414662825430680.css] 158.4 ms 183.9 ms -13.82%
css_analyzer[tachyons_11778168428173736564.css] 151.8 ms 187.7 ms -19.13%
react.production.min_3378072959512366797.js[cached] 2 ms 1.8 ms +7.5%

Copy link
Contributor

@dyc3 dyc3 left a comment

Choose a reason for hiding this comment

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

Lets try to address the perf regression a little.


for declaration in rule.declarations.iter() {
let property = &declaration.property;
let prop_name = property.name.to_lowercase();
Copy link
Contributor

Choose a reason for hiding this comment

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

You could add and use an alternative to to_ascii_lowercase_cow in biome_string_case eg to_lowercase_cow

@togami2864
Copy link
Contributor Author

I think allmost part of this perf regression is caused by the use of the CSS Semantic Model. I'll see if there's room for performance improvement.

@ematipico
Copy link
Member

I think allmost part of this perf regression is caused by the use of the CSS Semantic Model. I'll see if there's room for performance improvement.

We should really have a look at that, and understand if the cause is the semantic model or the rule.

You could create a "fake" rule that uses the semantic model, and always trigger the rule.

I believe it's important, because we don't have these kinds of regressions in the JavaScript rules, and when we do, it's usually caused by the business logic of the rule.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Diagnostic Area: diagnostocis A-Linter Area: linter A-Project Area: project L-CSS Language: CSS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Implement stylelint/declaration-block-no-duplicate-properties
3 participants