Add curly ESLint rule to enforce braces for control statements#5159
Draft
Add curly ESLint rule to enforce braces for control statements#5159
Conversation
Copilot
AI
changed the title
[WIP] Add curly rule to ESLint configuration
Add curly ESLint rule to enforce braces for control statements
Feb 13, 2026
thomasdax98
reviewed
Feb 13, 2026
Co-authored-by: thomasdax98 <13380047+thomasdax98@users.noreply.github.com>
Co-authored-by: thomasdax98 <13380047+thomasdax98@users.noreply.github.com>
3f0eff0 to
c27778b
Compare
Member
|
@copilot Fix all linting errors |
Contributor
Author
Contributor
|
This might result into a lot of merge conflicts, so I would probably merge this only if we are close to the v9 release. |
dkarnutsch
previously approved these changes
Feb 14, 2026
Collaborator
|
@copilot merge next and fix conflicts. |
…e-eslint-config # Conflicts: # packages/api/cms-api/src/user-permissions/auth/user-permissions.guard.spec.ts
Contributor
Author
Collaborator
|
@copilot fix all linting errors. |
Co-authored-by: johnnyomair <48853629+johnnyomair@users.noreply.github.com>
Contributor
Author
Fixed linting errors in 3 files from the next branch merge (commit 6dae21a). The merge brought in new code that didn't comply with the curly rule in:
All files now have braces around single-line if statements. |
johnnyomair
reviewed
Feb 17, 2026
Collaborator
johnnyomair
left a comment
There was a problem hiding this comment.
This could become annoying when merging main into next. Should we target main instead and add it to the future config?
Member
|
We'll fix and merge this shortly before v9 release |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
curly: ["error", "all"]to the core ESLint config to enforce braces for all control statements, eliminating style inconsistencies between:This change includes fixing all existing linting errors caused by the new rule across the entire codebase (215 files total), merging the latest changes from the
nextbranch, and correcting comment placement for better code style.Changes
curlyrule topackages/eslint-config/core.jsnextjs.js,react.js,nestjs.js(they only usereact/jsx-curly-brace-presence)generate-service-hook-call.ts,nested-two-level.spec.ts,find-hooks-service.spec.ts)nextbranch (7805 commits) and resolved merge conflict inuser-permissions.guard.spec.ts} //comment) have been moved to appear before or inside the conditional blocksAcceptance criteria
Screenshots/screencasts
Open TODOs/questions
None
Further information
The code changes are compatible with and now merged into the latest
nextbranch. All linting errors have been resolved by automatically adding braces to single-line control statements throughout the codebase. One merge conflict was resolved where the curly brace formatting conflicted with a newAFFECTED_SCOPE_METADATA_KEYdecorator check added in next. After the merge, 3 additional files introduced by next required curly brace fixes, which have been applied. Additionally, inline comments that were positioned after closing braces have been moved inside or before the conditional blocks for improved code style and readability.View original Slack conversation
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.