Skip to content

Conversation

canerakdas
Copy link
Member

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

@Copilot Copilot AI review requested due to automatic review settings September 1, 2025 21:35
@canerakdas canerakdas requested review from a team as code owners September 1, 2025 21:35
Copy link

vercel bot commented Sep 1, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Updated (UTC)
nodejs-org Ready Ready Preview Sep 1, 2025 9:36pm

Copy link
Contributor

@Copilot Copilot AI left a 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.

Copy link

codecov bot commented Sep 1, 2025

Codecov Report

❌ Patch coverage is 70.00000% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.60%. Comparing base (fd6b7e6) to head (5890623).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
...s/remark-lint/src/rules/yaml/ordered-yaml-keys.mjs 0.00% 3 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

@avivkeller avivkeller added this pull request to the merge queue Sep 3, 2025
Merged via the queue into nodejs:main with commit c58412e Sep 3, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants