Skip to content

Add curly ESLint rule to enforce braces for control statements#5159

Draft
Copilot wants to merge 8 commits intonextfrom
copilot/add-curly-rule-eslint-config
Draft

Add curly ESLint rule to enforce braces for control statements#5159
Copilot wants to merge 8 commits intonextfrom
copilot/add-curly-rule-eslint-config

Conversation

Copy link
Contributor

Copilot AI commented Feb 13, 2026

Description

Adds curly: ["error", "all"] to the core ESLint config to enforce braces for all control statements, eliminating style inconsistencies between:

// Before: Both styles acceptable
if (condition) statement;
if (condition) { statement; }

// After: Only braced style allowed
if (condition) { statement; }

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 next branch, and correcting comment placement for better code style.

Changes

  • Added curly rule to packages/eslint-config/core.js
  • Verified no overrides in nextjs.js, react.js, nestjs.js (they only use react/jsx-curly-brace-presence)
  • Created major changeset following CONTRIBUTING.md format (one-sentence title with additional details below)
  • Fixed all linting errors by adding braces to control statements in 203 files:
    • 200 files across packages, demo applications, and documentation (initial fix)
    • 3 additional files from next branch merge (generate-service-hook-call.ts, nested-two-level.spec.ts, find-hooks-service.spec.ts)
  • Merged latest next branch (7805 commits) and resolved merge conflict in user-permissions.guard.spec.ts
  • Moved inline comments inside conditional blocks for better code style (12 files):
    • Comments that were placed after closing braces (e.g., } //comment) have been moved to appear before or inside the conditional blocks
    • Improves code readability and follows better commenting practices

Acceptance criteria

Screenshots/screencasts

Before After
N/A - ESLint configuration change N/A - ESLint configuration change

Open TODOs/questions

None

Further information

The code changes are compatible with and now merged into the latest next branch. 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 new AFFECTED_SCOPE_METADATA_KEY decorator 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.

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
Copilot AI requested a review from thomasdax98 February 13, 2026 10:35
Copilot AI and others added 3 commits February 13, 2026 13:26
Co-authored-by: thomasdax98 <13380047+thomasdax98@users.noreply.github.com>
Co-authored-by: thomasdax98 <13380047+thomasdax98@users.noreply.github.com>
@thomasdax98 thomasdax98 force-pushed the copilot/add-curly-rule-eslint-config branch from 3f0eff0 to c27778b Compare February 13, 2026 12:27
@thomasdax98 thomasdax98 removed their request for review February 13, 2026 12:28
@thomasdax98 thomasdax98 marked this pull request as ready for review February 13, 2026 12:28
@auto-assign auto-assign bot requested a review from johnnyomair February 13, 2026 12:28
@thomasdax98 thomasdax98 marked this pull request as draft February 13, 2026 12:34
@thomasdax98
Copy link
Member

@copilot Fix all linting errors

Copy link
Contributor Author

Copilot AI commented Feb 13, 2026

@copilot Fix all linting errors

Fixed all linting errors caused by the new curly rule (commit 626eae8). Applied automatic formatting to 200 files across the codebase, adding braces to all single-line control statements.

@thomasdax98 thomasdax98 marked this pull request as ready for review February 14, 2026 10:50
@dkarnutsch
Copy link
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
dkarnutsch previously approved these changes Feb 14, 2026
@thomasdax98 thomasdax98 added this to the v9 milestone Feb 14, 2026
@johnnyomair
Copy link
Collaborator

@copilot merge next and fix conflicts.

…e-eslint-config

# Conflicts:
#	packages/api/cms-api/src/user-permissions/auth/user-permissions.guard.spec.ts
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot merge next and fix conflicts.

Merged next branch into this PR (commit 815af90). Resolved one merge conflict in user-permissions.guard.spec.ts where the curly brace formatting conflicted with a new AFFECTED_SCOPE_METADATA_KEY decorator check added in next.

@johnnyomair
Copy link
Collaborator

@copilot fix all linting errors.

Co-authored-by: johnnyomair <48853629+johnnyomair@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Feb 16, 2026

@copilot fix all linting errors.

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:

  • generate-service-hook-call.ts
  • nested-two-level.spec.ts
  • find-hooks-service.spec.ts

All files now have braces around single-line if statements.

Copy link
Collaborator

@johnnyomair johnnyomair left a comment

Choose a reason for hiding this comment

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

This could become annoying when merging main into next. Should we target main instead and add it to the future config?

Copilot AI requested a review from johnnyomair February 17, 2026 12:21
@johnnyomair johnnyomair removed their request for review February 17, 2026 13:20
@johnnyomair johnnyomair mentioned this pull request Feb 18, 2026
8 tasks
@thomasdax98 thomasdax98 marked this pull request as draft March 2, 2026 09:15
@thomasdax98
Copy link
Member

We'll fix and merge this shortly before v9 release

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.

4 participants