prettier /eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with Prettier.

★ 5,899⑂ 259👁 27⑃ 171● 203▤ 11
JavaScriptMITCreated 2017-01-29npm.im/eslint-config-prettier
TA的项目
下载:v10.1.8v10.1.8 ↓10.1.82025-07-18
+0
日增长
5,899
stars
259
forks
27
watchers
171
prs
203
issues
11
releases

README

eslint-config-prettier

Turns off all rules that are unnecessary or might conflict with [Prettier].

This lets you use your favorite shareable config without letting its stylistic choices get in the way when using Prettier.

Note that this config _only_ turns rules _off,_ so it only makes sense using it together with some other config.

[prettier]: https://github.com/prettier/prettier

 Installation

1. Install eslint-config-prettier:

   shell
   npm i -D eslint-config-prettier
   

   shell
   yarn add -D eslint-config-prettier
   

   shell
   pnpm add -D eslint-config-prettier
   

   shell
   bun add -D eslint-config-prettier
   

2. Add eslint-config-prettier to your ESLint configuration – either to [eslintrc] or to [eslint.config.js (flat config)].

   - eslintrc: Add "prettier" to the "extends" array in your .eslintrc. file. Make sure to put it last, so it gets the chance to override other configs.

     
     json
     {
       "extends": [
         "some-other-config-you-use",
         "prettier"
       ]
     }
     

   - eslint.config.js (flat config): Import eslint-config-prettier, and put it in the configuration array – after other configs that you want to override.

     
     js
     import someConfig from "some-other-config-you-use";
     // Note the /flat suffix here, the difference from default entry is that
     // /flat added name property to the exported object to improve
     // config-inspector experience.
     import eslintConfigPrettier from "eslint-config-prettier/flat";

     export default [
       someConfig,
       eslintConfigPrettier,
     ];
     

3. Finally, run the CLI helper tool to find problems in the "rules" sections of your config.

 👉 Using [eslint-plugin-prettier]? Check out [eslint-plugin-prettier’s recommended config][eslint-plugin-prettier-recommended].

 Plugins

eslint-config-prettier not only turns off _core_ rules, but also some from these plugins automatically:

- [@babel/eslint-plugin]
- [@stylistic/eslint-plugin]
- [@typescript-eslint/eslint-plugin]
- [eslint-plugin-babel]
- [eslint-plugin-flowtype]
- [eslint-plugin-react]
- [eslint-plugin-standard]
- [eslint-plugin-unicorn]
- [eslint-plugin-vue]

 ℹ️ Note: You might find guides on the Internet saying you should also extend stuff like "prettier/react". Since version 8.0.0 of eslint-config-prettier, all you need to extend is "prettier"! That includes all plugins.

 eslint.config.js (flat config) plugin caveat

With flat config, _you_ get to decide the plugin name! For example:

js
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import eslintConfigPrettier from "eslint-config-prettier/flat";

export default [
  {
    plugins: {
      // You’d typically use one of the following two:
      // typescriptEslint: typescriptEslint,
      // typescriptEslint,
      // But in this example we give it another name.
      // It might be tempting to use something shorter like “ts”:
      ts: typescriptEslint, // 🚨 Don’t do this!
    },
   

Top issues

Latest release

v10.1.8 v10.1.8 2025-07-18
republish latest version

Full Changelog: https://github.com/prettier/eslint-config-prettier/compare/v10.1.5...v10.1.8

Snapshot: 2026-11-16T09:23:14Z · Data license Apache-2.0 · JSON