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_js_analyzer): useConsistentStringFunctions #3038

Closed

Conversation

chansuke
Copy link
Member

@chansuke chansuke commented Jun 1, 2024

Summary

Fixes #2817

Test Plan

@github-actions github-actions bot added A-Project Area: project A-Linter Area: linter L-JavaScript Language: JavaScript and super languages A-Diagnostic Area: diagnostocis labels Jun 1, 2024
Copy link

codspeed-hq bot commented Jun 1, 2024

CodSpeed Performance Report

Merging #3038 will degrade performances by 6.36%

Comparing chansuke:feat/use-consistent-string-functions (98524d5) with main (cd6e830)

Summary

❌ 1 regressions
✅ 91 untouched benchmarks

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

Benchmarks breakdown

Benchmark main chansuke:feat/use-consistent-string-functions Change
dojo.js[uncached] 9 ms 9.6 ms -6.36%

Copy link
Contributor

@minht11 minht11 left a comment

Choose a reason for hiding this comment

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

Sorry if review is bit early, few suggestions

@chansuke
Copy link
Member Author

chansuke commented Jun 2, 2024

@minht11
Thank you so much for your feedback!

@chansuke chansuke marked this pull request as ready for review June 2, 2024 14:20
@chansuke
Copy link
Member Author

chansuke commented Jun 2, 2024

@minht11
I've updated my branch with the latest changes. Could you please review it when you have a time🙏

@chansuke chansuke requested a review from minht11 June 2, 2024 14:22
}

fn action(ctx: &RuleContext<Self>, _: &Self::State) -> Option<JsRuleAction> {
let node = ctx.query();
Copy link
Contributor

Choose a reason for hiding this comment

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

We are duplicating work a bit, lets find name node in diagnostic and pass it in state so you can directly replace it here. You can also check if fix should be available in diagnostic too, for example if substring has arguments and so on.

Copy link
Member Author

Choose a reason for hiding this comment

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

@minht11
Thank yo for your suggestion. Yes, I will refactor this later:)

@ematipico
Copy link
Member

We agreed to use the Methods instead of Functions

@chansuke
Copy link
Member Author

chansuke commented Jun 4, 2024

Ok, I will use methods, instead of functions.

@chansuke
Copy link
Member Author

chansuke commented Jun 5, 2024

Close this PR due to a rule separation:

#2817 (comment)

@chansuke chansuke closed this Jun 5, 2024
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-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

📎 Implement useConsistentStringFunctions - unicorn prefer-string-trim-start-end prefer-string-slice
3 participants