Add eslint-config-prettier to defer formatting rules to Prettier#2630
Conversation
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
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Waiting for approvalThe following approvals are needed before I can proceed with the merge:
|
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
807193f to
d45f288
Compare
|
LGTM |
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
|
/approve |
|
I have successfully merged the changeset of this pull request
The following branches have NOT changed:
Please check the status of the associated issue ARSN-584. Goodbye delthas. The following options are set: approve |
What
eslint-config-prettieras the last entry ineslint.config.mjsso it turns off the ESLint formatting rules Prettier owns (indent,max-len, …), and add it as a devDependency (^10).max-lendisable comments that become unused oncemax-lenis off.eslint.config.mjs+ the 2 files whose comments are removed) is isolated in a separatechore: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 runsprettier --checkon the whole of each changed file — any PR that touches a previously-unformatted file is forced to Prettier-format it, which then failsyarn lint. The two checks impose opposite requirements and can't both be satisfied.indent/max-lencannot be configured to match Prettier (Prettier exposes no equivalent knobs), so the ESLint rules must be disabled for Prettier-enforcing code. Appendingeslint-config-prettierdoes 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-propshalf — which can be reconciled by config — is handled upstream in the shared config by switching Prettier toquoteProps: 'consistent'(GDL-15, scality/Guidelines#213).Context
quote-propshalf: GDL-15 — Set Prettier quoteProps to consistent to match eslint quote-props Guidelines#213eslint-config-prettierpart and left a whole-repo reformat for later.Issue: ARSN-584