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(lint): add useConsistentCurlyBraces #3182

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dyc3
Copy link
Contributor

@dyc3 dyc3 commented Jun 11, 2024

Summary

This PR adds the useConsistentCurlyBraces lint. It doesn't implement any of the options from the eslint rule for simplicity.

This implementation aims to follow the recommendations outlined in the eslint rule: react/jsx-curly-brace-presence

closes #2435

Test Plan

Added snapshot tests

cargo test -p biome_js_analyze use_consistent_curly_braces

@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 11, 2024
Copy link

codspeed-hq bot commented Jun 11, 2024

CodSpeed Performance Report

Merging #3182 will degrade performances by 6.35%

Comparing dyc3:06-02-feat_lint_add_usejsxcurlybraceconvention_ (7890fbe) with main (1218c3a)

Summary

❌ 1 regressions
✅ 107 untouched benchmarks

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

Benchmarks breakdown

Benchmark main dyc3:06-02-feat_lint_add_usejsxcurlybraceconvention_ Change
db_2930068967297060348.json[cached] 12.7 ms 13.6 ms -6.35%

@dyc3 dyc3 force-pushed the 06-02-feat_lint_add_usejsxcurlybraceconvention_ branch from d81ef73 to 39f6256 Compare June 14, 2024 15:11
@github-actions github-actions bot added the A-CLI Area: CLI label Jun 14, 2024
@dyc3 dyc3 force-pushed the 06-02-feat_lint_add_usejsxcurlybraceconvention_ branch 3 times, most recently from fe22002 to 5309e5f Compare June 15, 2024 13:10
@dyc3 dyc3 marked this pull request as ready for review June 15, 2024 13:11
@dyc3 dyc3 force-pushed the 06-02-feat_lint_add_usejsxcurlybraceconvention_ branch from 5309e5f to a28ee0f Compare June 22, 2024 22:19
@dyc3 dyc3 force-pushed the 06-02-feat_lint_add_usejsxcurlybraceconvention_ branch 3 times, most recently from fdcc6c3 to 962f7a4 Compare June 29, 2024 22:44
@dyc3 dyc3 requested a review from chansuke June 29, 2024 22:44
@chansuke
Copy link
Member

Great work! Thank you :)

@dyc3 dyc3 changed the title feat(lint): add useJsxCurlyBraceConvention feat(lint): add useConsistentCurlyBraces Jul 2, 2024
@dyc3 dyc3 force-pushed the 06-02-feat_lint_add_usejsxcurlybraceconvention_ branch 3 times, most recently from 7b46bf8 to 5d6bcf6 Compare July 5, 2024 11:05
@dyc3
Copy link
Contributor Author

dyc3 commented Jul 5, 2024

Hit a small blocker with this merge conflict. Usually other rules getting added causes these merge conflicts, and running just gen-lint usually fixes it, but this time it's throwing cannot find macro rule_category in this scope. Would the easiest fix be to just redo the codegen on a fresh branch?

@dyc3 dyc3 requested a review from ematipico July 5, 2024 11:12
@ematipico
Copy link
Member

@dyc3 declare_rule has been renamed declare_lint_rule. That will fix everything

@dyc3 dyc3 force-pushed the 06-02-feat_lint_add_usejsxcurlybraceconvention_ branch from 5d6bcf6 to fd07089 Compare July 5, 2024 11:59
@dyc3 dyc3 force-pushed the 06-02-feat_lint_add_usejsxcurlybraceconvention_ branch from fd07089 to 7890fbe Compare July 6, 2024 00:18
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-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 lint/useJsxCurlyBraceConvention - react/jsx-curly-brace-presence
3 participants