-
-
Notifications
You must be signed in to change notification settings - Fork 6.4k
chore: enforce curly braces for control statements #8133
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
Conversation
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds enforcement for curly braces on all control statements by implementing the ESLint curly
rule with the 'all'
setting. The changes ensure consistent code style across the codebase by requiring braces around all control statement bodies, even single-line statements.
Key changes:
- Added the
curly: ['error', 'all']
ESLint rule to enforce braces on all control statements - Updated existing code to comply with the new rule by adding braces to if statements, for loops, and other control structures
- Modified documentation examples to demonstrate the enforced style
Reviewed Changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
eslint.config.js | Added the curly braces ESLint rule enforcement |
packages/ui-components/src/Common/AvatarGroup/Avatar/index.tsx | Added braces to if statement |
packages/remark-lint/src/rules/yaml/ordered-yaml-keys.mjs | Added braces to early return if statement |
packages/remark-lint/src/rules/hashed-self-reference.mjs | Added braces to continue statement if condition |
docs/code-style.md | Updated style guide example to show proper brace usage |
apps/site/pages/en/learn/*.md | Updated code examples in documentation to use proper brace formatting |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #8133 +/- ##
=======================================
Coverage 76.60% 76.60%
=======================================
Files 115 115
Lines 9595 9602 +7
Branches 321 322 +1
=======================================
+ Hits 7350 7356 +6
- Misses 2244 2245 +1
Partials 1 1 ☔ View full report in Codecov by Sentry. |
Description
As per the discussion in the PR review:
#7794 (comment) #7794 (comment)
According to our current styling convention, we enforce the use of brackets in control statements. With this PR, we’re adding the corresponding ESLint rule to ensure consistency and improve the review/contribute process