{"id":19560,"library":"eslint-config-prettier","title":"eslint-config-prettier","description":"eslint-config-prettier is an ESLint shareable config that turns off all rules that are unnecessary or might conflict with Prettier. It selectively disables core ESLint rules and plugin rules (e.g., @typescript-eslint, import, react, unicorn) that are made redundant by Prettier's formatting. Version 10.1.8 is the current stable release, published as CommonJS with TypeScript declarations. The package follows a patch-only release cadence (no breaking changes since 10.x). Key differentiators: it is the official Prettier-ESLint integration maintained by the Prettier team, supports both legacy .eslintrc format and flat config via eslint-config-prettier/flat, and includes a CLI to check for conflicting rules. It requires eslint >=7.0.0.","status":"active","version":"10.1.8","language":"javascript","source_language":"en","source_url":"https://github.com/prettier/eslint-config-prettier","tags":["javascript","eslint","eslintconfig","eslint-config","eslint-prettier","prettier","typescript"],"install":[{"cmd":"npm install eslint-config-prettier","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-prettier","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-prettier","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"Use 'eslint-config-prettier' (full name) in .eslintrc.js or eslint.config.js. For legacy config, add to extends array; for flat config, use 'eslint-config-prettier/flat'.","wrong":"extends: ['prettier']","symbol":"eslint-config-prettier (legacy)","correct":"extends: ['eslint-config-prettier']"},{"note":"Since v10.1.0, the flat config entry is exported as a default object. Do not destructure; it's a single config object.","wrong":"import { configPrettier } from 'eslint-config-prettier'; export default [configPrettier];","symbol":"eslint-config-prettier/flat (flat config)","correct":"import configPrettier from 'eslint-config-prettier/flat'; export default [configPrettier, /* other configs */];"},{"note":"The package ships TypeScript declarations. For type-only imports, use 'import type' to avoid runtime errors.","wrong":"import { Config } from 'eslint-config-prettier';","symbol":"TypeScript types","correct":"import type { Config } from 'eslint-config-prettier';"}],"quickstart":{"code":"// .eslintrc.js (legacy)\nmodule.exports = {\n  extends: [\n    'some-other-config',\n    'eslint-config-prettier'\n  ]\n};\n\n// eslint.config.js (flat config - modern)\nimport js from '@eslint/js';\nimport configPrettier from 'eslint-config-prettier/flat';\n\nexport default [\n  js.configs.recommended,\n  configPrettier,\n  // your other configs\n];\n\n// Check for conflicting rules via CLI:\n// npx eslint-config-prettier path/to/eslint.config.js","lang":"javascript","description":"Shows both legacy .eslintrc and flat config usage, plus CLI check for conflicts."},"warnings":[{"fix":"Update ESLint to >=7 and ensure you are using CommonJS or ESM correctly. For flat config, import 'eslint-config-prettier/flat'.","message":"v10.0.0 dropped support for ESLint <7 and switched to CommonJS-only exports. TypeScript configs may break.","severity":"breaking","affected_versions":">=10.0.0"},{"fix":"Change import from 'eslint-config-prettier' to 'eslint-config-prettier/flat' in flat ESLint configs.","message":"The 'eslint-config-prettier' entry point for flat config (without '/flat') is deprecated since v10.1.0. Use 'eslint-config-prettier/flat'.","severity":"deprecated","affected_versions":">=10.1.0"},{"fix":"Always include a base config like 'eslint:recommended' or '@eslint/js/recommended' before this config.","message":"eslint-config-prettier only turns off formatting rules; it does not enable any rules. You must still configure other configs (e.g., @eslint/js, @typescript-eslint) for linting logic.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev eslint-config-prettier'. In flat config, use 'eslint-config-prettier/flat'.","cause":"Package not installed or incorrect import path.","error":"Error: Cannot find module 'eslint-config-prettier'"},{"fix":"Use 'import configPrettier from 'eslint-config-prettier/flat'' instead of default import from root.","cause":"Using legacy default import for flat config (e.g., import prettier from 'eslint-config-prettier').","error":"TypeError: configPrettier is not a function or array"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}