๐ŸŒ
LogRocket
blog.logrocket.com โ€บ home โ€บ using prettier and eslint for javascript formatting
Using Prettier and ESLint for JavaScript formatting - LogRocket Blog
October 22, 2024 - Prettier focuses solely on code formatting, making it easier to set up and use when compared to ESLint, which has a broader range of functionality, including code linting and style checking.
๐ŸŒ
Expo Documentation
docs.expo.dev โ€บ integrations โ€บ tools โ€บ using eslint and prettier
Using ESLint and Prettier - Expo Documentation
3 weeks ago - It's a great tool to help you write better code and catch mistakes before they make it to production. In conjunction, you can use Prettier, a code formatter that ensures all the code files follow a consistent styling.
Discussions

Why use prettier if ESLint can format?
Because Prettier generally does a better job of formatting than ESLint. This is for three reasons: It's really fast, particularly in comparison to ESLint. Prettier is designed to format documents and that's it, which means it can be a lot simpler than ESLint, at least architecturally, especially as there's relatively little in the way of plugins. So if you just need to format your code quickly in one chunk, Prettier is the way to go. Prettier is already preconfigured, so it's also usually quicker to get started with. ESLint has some default formatting rules IIRC, but relatively minimal ones. To ensure every detail is formatted the same way, you need to put a lot of effort into configuring ESLint, which most people don't really want to do. Related: Conceptually, Prettier formats holistically, which is to say, it takes a whole document and applies its formatting to every single syntax node - generally, this means that you get very close to having exactly one valid output, no matter how the input file is formatted. ESLint, on the other hand, not only requires each formatting rule to be configured individually, but also applies them generally individually, so it's easier to have cases where you can get inconsistent behaviour depending on the original formatting of the file. More on reddit.com
๐ŸŒ r/node
55
88
July 27, 2022
visual studio code - In VSCode, how do I effectively run eslint --fix and prettier --write on "Format Document"? - Stack Overflow
For context, I've locally installed prettier, eslint, and their respective VS Code extensions. I used the word "effectively" in my title because I don't literally need to run eslint --fix; More on stackoverflow.com
๐ŸŒ stackoverflow.com
Prettier doesn't format based on my eslint config
I have installed Eslint-Prettier extension on VSCode. I already have an .eslintrc.js and my default formatter (Eslint-prettier) doesn't format according to my eslint rules. For example: when i typ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
prettier vs eslint?
Prettier + ESLint ๐Ÿ‘Œ๐Ÿผ More on reddit.com
๐ŸŒ r/node
12
0
March 19, 2025
๐ŸŒ
Biome
biomejs.dev โ€บ guides โ€บ migrate-eslint-prettier
Migrate from ESLint and Prettier | Biome
Since ESLint takes VCS ignore files into account, we recommend that you enable Biomeโ€™s VCS integration. ... Some plugins or shared configurations may export an object with a cyclic reference. Biome may fail to load such a configuration. ... Biome tries to match the Prettier formatter as closely as possible.
๐ŸŒ
DEV Community
dev.to โ€บ rgolawski โ€บ how-to-make-eslint-and-prettier-work-together-2i5g
How to make ESLint and Prettier work together ๐Ÿ› ๏ธ - DEV Community
July 8, 2024 - Note that the following steps are for the demonstration purposes only - I've tried this with Next.js, Remix and Vite React ESLint configurations, and it worked well in those cases. So, without further-ado, let's set up a new project with these commands: mkdir awesome-project cd awesome-project npm init -y ยท Next, we will need to install the required dependencies: npm install --save-dev eslint-plugin-prettier eslint-config-prettier npm install --save-dev --save-exact prettier
๐ŸŒ
Josh Finnie
joshfinnie.com โ€บ blog โ€บ adding-eslint-and-prettier-to-my-blog
Adding ESLint & Prettier to My Blog | www.joshfinnie.com
December 2, 2024 - Enter Prettier and ESLint โ€” two powerful tools that improve code consistency and catch potential issues early. Prettier formats every file uniformly, saving hours of manual formatting work.
Find elsewhere
๐ŸŒ
Robin Wieruch
robinwieruch.de โ€บ prettier-eslint
How to use Prettier with ESLint - Robin Wieruch
February 14, 2022 - How to combine Prettier and ESLint for VSCode, Sublime, or any other IDE/editor. You will get to know the ESLint Prettier Rules that are needed to get you started ...
๐ŸŒ
GitHub
github.com โ€บ prettier โ€บ eslint-config-prettier
GitHub - prettier/eslint-config-prettier: Turns off all rules that are unnecessary or might conflict with Prettier. ยท GitHub
Some of the rules that eslint-config-prettier turns off may be deprecated, or even removed from ESLint. This is perfectly fine, but if you really need to omit the deprecated and removed rules, you can do so by setting the ESLINT_CONFIG_PRETTIER_NO_DEPRECATED environment variable to a non-empty value.
Starred by 5.9K users
Forked by 262 users
Languages ย  JavaScript
๐ŸŒ
GitHub
github.com โ€บ prettier โ€บ eslint-plugin-prettier
GitHub - prettier/eslint-plugin-prettier: ESLint plugin for Prettier formatting ยท GitHub
Runs Prettier as an ESLint rule and reports differences as individual ESLint issues.
Starred by 3.6K users
Forked by 212 users
Languages ย  JavaScript
๐ŸŒ
Reddit
reddit.com โ€บ r/node โ€บ why use prettier if eslint can format?
r/node on Reddit: Why use prettier if ESLint can format?
July 27, 2022 -

I've heard ESLint can format but I haven't found a clear answer why it seems prettier is used instead of the ESLint formatter. Whenever I try to look it up most comments neglect to mention that ESLint can also format so it's not obvious why prettier would be needed at all.

๐ŸŒ
npm
npmjs.com โ€บ package โ€บ prettier-eslint
prettier-eslint - npm
May 7, 2025 - The fix feature of eslint is pretty great and can auto-format/fix much of your code according to your ESLint config. prettier is a more powerful automatic formatter. One of the nice things about prettier is how opinionated it is.
      ยป npm install prettier-eslint
    
Published ย  May 07, 2025
Version ย  16.4.2
Author ย  Kent C. Dodds
๐ŸŒ
Visual Studio Marketplace
marketplace.visualstudio.com โ€บ items
Prettier ESLint - Visual Studio Marketplace
Extension for Visual Studio Code - A Visual Studio Extension to format JavaScript and Typescript code using prettier-eslint package
๐ŸŒ
npm
npmjs.com โ€บ package โ€บ eslint-config-prettier
eslint-config-prettier - npm
July 18, 2025 - Some of the rules that eslint-config-prettier turns off may be deprecated, or even removed from ESLint. This is perfectly fine, but if you really need to omit the deprecated and removed rules, you can do so by setting the ESLINT_CONFIG_PRETTIER_NO_DEPRECATED environment variable to a non-empty value.
      ยป npm install eslint-config-prettier
    
Published ย  Jul 18, 2025
Version ย  10.1.8
Author ย  Simon Lydell
Top answer
1 of 2
10

VSCode doesn't support chaining multiple formatters. More at this related question.

But chaining formatters isn't the answer to your problem. If you're using Prettier and ESLint properly then they do not overlap in their ruleset. You can use eslint-plugin-prettier to format the document with only ESLint and it will run Prettier as an ESLint rule. Adding eslint-config-prettier disables any ESLint rules that would conflict with Prettier.

Afterwards, running eslint --fix would apply both your ESLint and Prettier rules in a single format.

If you would like to use ESLint with other filetypes then you need to find ESLint plugins that work for those filetypes. They require installation and configuration unique to each plugin. An example is eslint-plugin-jsonc to add support for JSONC.

In package.json:

{
  "devDependencies": {
    "@typescript-eslint/eslint-plugin": "^6.10.0",
    "@typescript-eslint/parser": "^6.10.0",
    "eslint": "^8.53.0",
    "eslint-config-prettier": "^9.0.0",
    "eslint-plugin-prettier": "^5.0.1",
    "prettier": "^3.0.3",
    "typescript": "^5.2.2"
  }
}

In .eslintrc.json:

{
  "extends": [
    "plugin:prettier/recommended" // must be last element in "extends"
  ],
  "parser": "@typescript-eslint/parser",
  "plugins": [
    "@typescript-eslint"
  ],
  "settings": {
    "import/parsers": {
      "@typescript-eslint/parser": [
        ".ts"
      ]
    },
  }
}

Set your Prettier rules in .prettierrc.json, for example:

{
  "printWidth": 100
}

Now eslint --fix will format the document in a single pass.

For VSCode, install both the dbaeumer.vscode-eslint and the esbenp.prettier-vscode extensions. These each require you to have the corresponding npm package installed, whether locally in your app or globally on your device. You may also need to configure VSCode so that it can find the packages, depending on how they were installed.

Then when you run Format Document With and select ESLint it will apply both your ESLint and Prettier rules with the equivalent of eslint --fix. For example, leaving a trailing space will trigger this INFO alert:

Delete `ยท` eslint (prettier/prettier)

Formatting the document with ESLint resolves the issue.

2 of 2
1

This bugged me ALOT as well. There are a lot of resources online about different ways. The problem is most of them are outdated, don't work, require some config adjustments, and have their own set of trade-offs.

Here was the solution I ended up going with:

I just added this to my users keybindings.json:

{
    "key": "cmd+alt+f",
    "command": "workbench.action.terminal.sendSequence",
    "args": {
        "text": "npx prettier --write '${file}' > /dev/null 2>&1 && npx eslint_d --fix '${file}' > /dev/null 2>&1 & \u000D" // The CLI command to run "\u000D" is just the return key.
    },
    "when": "editorTextFocus"
},

That command uses eslint_d but thats just a performance enhancement. You could just as easily use eslint instead.

If you want to get it to run on save. You can try vscode-run-on-save

The benefit of this was it just works across any flavor of vscode like cursor, windsurf, etc. I don't have to muck with configs or any other setup.

Hope this helps someone else :).

๐ŸŒ
Medium
simon-lutterbie.medium.com โ€บ code-quality-prettier-and-eslint-bfd8fff5da98
Code quality: Prettier and ESLint | by Simon Lutterbie | Medium
February 5, 2021 - Prettier maintains code formatting โ€” use an IDE plugin like VSCode Prettier Plugin and it will format your files on save. And ESLint enforces a wide range of syntax rules and coding best practices that might otherwise sneak under the radar.
๐ŸŒ
Prettier
prettier.io โ€บ docs โ€บ integrating-with-linters.html
Integrating with Linters ยท Prettier
Most stylistic rules are unnecessary when using Prettier, but worse โ€“ they might conflict with Prettier! Use Prettier for code formatting concerns, and linters for code-quality concerns, as outlined in Prettier vs.
Top answer
1 of 2
18
  1. Install eslint:
    npm i --save-dev eslint
    
  2. Init eslint:
    npx eslint --init
    
    For some options you need choose next:
    • How would you like to use ESLint?
    • To check syntax and find problems
    • What format do you want your config file to be in?
    • JavaScript
  3. Install prettier:
    npm i --save-dev eslint-config-prettier eslint-plugin-prettier prettier 
    
  4. Create .prettierrc config file:
     {
         "printWidth": 80,
         "singleQuote": true,
         "trailingComma": "es5"
     }
    

At now you can check style with eslint and fix style with prettier from comand line.

For VSCode integration with eslint and prettier you need to install one of:

  1. esbenp.prettier-vscode.
  2. dbaeumer.vscode-eslint;

After that you need to set this extension as default formatter:

  1. Open command pallette ctrl+shift+p;
  2. Select Format Document With...;
  3. Select Configure Document With...;
  4. Select Prettier - Code Formatter or ESLint based on your preferences.

Now, eslint will work as linter and prettier as formatter:

VSCode problem tab:

eslint output

If I save file all prettier problems will be fixed (Autoformat on save should be turned on)

Eslint plugin does not apply automatically changes in settings located in .prettierrc. See issue on github. To fix this you can:

  • move .prettierrc content in .eslint (not recommended because prettier plugins sometimes do not read this file);
  • run from command pallette in VSCode ESLint: Restart ESLint server after edit .prettierrc file.
2 of 2
16

in eslint config, change


  extends: ["prettier"],

to


  extends: ['plugin:prettier/recommended'],