Skip to content

eslint-prettier

Use when setting up code linting and formatting with ESLint and Prettier — configuration, rule customization, IDE integration, or CI enforcement. Also use when migrating ESLint to flat config or resolving ESLint/Prettier conflicts.

ModelSource
sonnetpack: tooling
Full Reference

┏━ 🔧 eslint-prettier ━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when setting up code linting and formattin… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

ESLint 9 (current) uses flat config (eslint.config.js) by default — the legacy .eslintrc format is deprecated in v9 and removed in v10. Prettier 3.x handles formatting. They integrate via eslint-config-prettier (disables conflicting rules) plus an optional eslint-plugin-prettier for running Prettier as a lint rule.

The recommended integration runs ESLint for code quality and Prettier CLI separately for formatting, keeping the two concerns clean and CI fast.

ItemValue
ESLintv9.x (flat config default)
Prettierv3.x (latest: 3.8.x)
Config fileeslint.config.js (or .mjs)
Prettier config.prettierrc or prettier.config.js
Installnpm install -D eslint @eslint/js prettier eslint-config-prettier
Run lintnpx eslint .
Run formatnpx prettier --write .
Format check (CI)npx prettier --check .
Migrate from .eslintrcnpx @eslint/migrate-config .eslintrc.json
I want to…File
Set up ESLint and Prettier from scratchreference/setup.md
Configure rules, integration strategies, and custom rulesreference/rules.md
Add TypeScript support and type-aware rulesreference/typescript.md
Configure React and Next.js pluginsreference/react.md
Ignore specific files and pathsreference/ignoring.md
Set up GitHub Actions, pre-commit hooks, and IDE integrationreference/ci-integration.md
Migrate from .eslintrc to flat configreference/migration.md

Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.