Skip to content

feat(stylistic): move prettier/prettier into an opt-in stylistic/prettier config - #212

Merged
alexander-akait merged 2 commits into
mainfrom
feat/opt-in-prettier-config
Oct 1, 2026
Merged

alexander-akait merged 2 commits into
mainfrom
feat/opt-in-prettier-config

Conversation

@alexander-akait

@alexander-akait alexander-akait commented Oct 1, 2026 •

Copy link
Copy Markdown
Member

Summary

Every recommended preset runs Prettier as a lint rule (prettier/prettier from stylistic/recommended), so ESLint formats every file again. It is the most expensive rule we have; on a cold ESLint run over the webpack repo (TIMING=all):

Rule Time Share of rule time
prettier/prettier 76.8s 26%

Projects that also run prettier --check pay for it twice. Prettier's own docs recommend running it separately and formatting on save in the editor.

This PR:

  • removes the Prettier plugin and prettier/prettier from stylistic/recommended, so from every recommended preset;
  • adds the opt-in stylistic/prettier config, which restores the old behavior;
  • documents in the README how to run Prettier on its own with the shared prettier-config.js;
  • makes this repo check its own formatting with prettier --check (fmt:check, now part of lint).

stylistic/recommended spread eslint-plugin-prettier/recommended and then replaced its rules, so only the plugin and prettier/prettier were ever active. Extending config plus stylistic/prettier gives exactly the previous rule set.

What kind of change does this PR introduce?

feat

Did you add tests for your changes?

Yes, test/stylistic-prettier.test.js: no config in the default preset enables prettier/prettier, and stylistic/prettier reports unformatted code. It fails without this change. I also checked the README setup (prettier.config.mjs re-exporting eslint-config-webpack/prettier-config.js) in a CommonJS project.

Does this PR introduce a breaking change?

No. Released as a minor change, since this config is used internally by webpack projects. ESLint no longer reports formatting: run prettier --check . in CI as the README shows, or extend configs["stylistic/prettier"] to keep the old behavior.

If relevant, what needs to be documented once your changes are merged or what have you already documented?

Documented in the README's new "Prettier" section.

Use of AI

Claude Code measured the rule cost on webpack, split the config, wrote the docs and the test, and checked the documented setup. The author reviewed and directed the work.

🤖 Generated with Claude Code

https://claude.ai/code/session_01KRwzDhXwa4BrshnUFHE711

…ttier config

Running Prettier as a lint rule formats every file again inside ESLint;
in webpack it was ~26% of a cold run. The recommended configs no longer
include it. The README explains running Prettier on its own with the
shared options, and stylistic/prettier restores the old behavior. This
repository now checks its own formatting with `prettier --check`.
@changeset-bot

changeset-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d7e85f5

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-config-webpack Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@alexander-akait alexander-akait changed the title feat(stylistic)!: move prettier/prettier into an opt-in stylistic/prettier config feat(stylistic): move prettier/prettier into an opt-in stylistic/prettier config Oct 1, 2026
@alexander-akait
alexander-akait merged commit 8e7805c into main Oct 1, 2026
12 checks passed
@alexander-akait
alexander-akait deleted the feat/opt-in-prettier-config branch October 1, 2026 09:57
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.

1 participant