Skip to content

Add eslint-config-prettier to defer formatting rules to Prettier#2630

Open
delthas wants to merge 3 commits into
development/8.4from
improvement/ARSN-584/eslint-config-prettier
Open

Add eslint-config-prettier to defer formatting rules to Prettier#2630
delthas wants to merge 3 commits into
development/8.4from
improvement/ARSN-584/eslint-config-prettier

Conversation

@delthas
Copy link
Copy Markdown
Contributor

@delthas delthas commented May 27, 2026

What

  • Append eslint-config-prettier as the last entry in eslint.config.mjs so it turns off the ESLint formatting rules Prettier owns (indent, max-len, …), and add it as a devDependency (^10).
  • Remove the 4 max-len disable comments that become unused once max-len is off.
  • The prettier-formatting of the touched files (eslint.config.mjs + the 2 files whose comments are removed) is isolated in a separate chore: commit so the logic commit shows only the config change.

This does not run Prettier over the whole codebase — only the files this change touches are formatted.

Why

Arsenal inherits both its ESLint rules and its Prettier config from @scality/eslint-config-scality. Several ESLint formatting rules conflict with Prettier's output. Since arsenal enabled the Prettier CI check (ARSN-558) — which runs prettier --check on the whole of each changed file — any PR that touches a previously-unformatted file is forced to Prettier-format it, which then fails yarn lint. The two checks impose opposite requirements and can't both be satisfied.

indent/max-len cannot be configured to match Prettier (Prettier exposes no equivalent knobs), so the ESLint rules must be disabled for Prettier-enforcing code. Appending eslint-config-prettier does exactly that. This is scoped to arsenal — repos that use the shared config without Prettier keep their formatting lints.

Scope

This is the per-repo half of the fix. The companion quote-props half — which can be reconciled by config — is handled upstream in the shared config by switching Prettier to quoteProps: 'consistent' (GDL-15, scality/Guidelines#213).

Context

Issue: ARSN-584

Pre-existing prettier debt on the files the eslint-config-prettier work
touches (eslint.config.mjs + the two files whose now-unused max-len
disable comments are removed). Isolated so the config commit shows only
logic.

Issue: ARSN-584
@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 27, 2026

Hello delthas,

My role is to assist you with the merge of this
pull request. Please type @bert-e help to get information
on this process, or consult the user documentation.

Available options
name description privileged authored
/after_pull_request Wait for the given pull request id to be merged before continuing with the current one.
/bypass_author_approval Bypass the pull request author's approval
/bypass_build_status Bypass the build and test status
/bypass_commit_size Bypass the check on the size of the changeset TBA
/bypass_incompatible_branch Bypass the check on the source branch prefix
/bypass_jira_check Bypass the Jira issue check
/bypass_peer_approval Bypass the pull request peers' approval
/bypass_leader_approval Bypass the pull request leaders' approval
/approve Instruct Bert-E that the author has approved the pull request. ✍️
/create_pull_requests Allow the creation of integration pull requests.
/create_integration_branches Allow the creation of integration branches.
/no_octopus Prevent Wall-E from doing any octopus merge and use multiple consecutive merge instead
/unanimity Change review acceptance criteria from one reviewer at least to all reviewers
/wait Instruct Bert-E not to run until further notice.
Available commands
name description privileged
/help Print Bert-E's manual in the pull request.
/status Print Bert-E's current status in the pull request TBA
/clear Remove all comments from Bert-E from the history TBA
/retry Re-start a fresh build TBA
/build Re-start a fresh build TBA
/force_reset Delete integration branches & pull requests, and restart merge process from the beginning.
/reset Try to remove integration branches unless there are commits on them which do not appear on the source branch.

Status report is not available.

@bert-e
Copy link
Copy Markdown
Contributor

bert-e commented May 27, 2026

Waiting for approval

The following approvals are needed before I can proceed with the merge:

  • the author

  • 2 peers

delthas added 2 commits May 27, 2026 17:09
The shared @scality/eslint-config-scality config enforces formatting
rules (indent, max-len) that conflict with Prettier's output. Since
arsenal enabled the Prettier CI check, any PR that prettier-formats a
file then fails `yarn lint` on those rules — and unlike quote-props,
indent/max-len cannot be configured to match Prettier (see GDL-15 for
the quote-props half).

Append eslint-config-prettier as the last entry in the flat config so
it turns off the formatting rules Prettier owns.

Issue: ARSN-584
With eslint-config-prettier turning off max-len, the existing
max-len eslint-disable directives no longer suppress anything, and
eslint flags them as unused. Remove them.

Issue: ARSN-584
@delthas delthas force-pushed the improvement/ARSN-584/eslint-config-prettier branch from 807193f to d45f288 Compare May 27, 2026 15:10
@claude
Copy link
Copy Markdown

claude Bot commented May 27, 2026

LGTM

Review by Claude Code

@delthas delthas marked this pull request as ready for review May 27, 2026 15:12
@delthas delthas requested review from a team, DarkIsDude, leif-scality and maeldonn May 27, 2026 15:12
@scality scality deleted a comment from claude Bot May 27, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented May 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.51%. Comparing base (93c267f) to head (d45f288).

Additional details and impacted files
@@                 Coverage Diff                 @@
##           development/8.4    #2630      +/-   ##
===================================================
- Coverage            73.55%   73.51%   -0.05%     
===================================================
  Files                  222      222              
  Lines                18214    18214              
  Branches              3798     3798              
===================================================
- Hits                 13398    13390       -8     
- Misses                4811     4818       +7     
- Partials                 5        6       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants