Add eslint-config-prettier to defer formatting rules to Prettier#2630
Open
delthas wants to merge 3 commits into
Open
Add eslint-config-prettier to defer formatting rules to Prettier#2630delthas wants to merge 3 commits into
delthas wants to merge 3 commits into
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
Contributor
Hello delthas,My role is to assist you with the merge of this Available options
Available commands
Status report is not available. |
Contributor
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:
|
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.
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