There are a number of ways to set up prettier to work with eslint and it can be confusing.

To run prettier as an eslint rule, you would want to add a rule that allows eslint to run prettier. You do that with the eslint-plugin-prettier plugin.

  "plugins": ["prettier"],          // Defines a rule that allows eslint to run prettier.
  "rules": {
    "prettier/prettier": "error"    // Turns on that rule.
  }

You would also want to turn off eslint rules that may conflct with prettier. You do this with the eslint-config-prettier extension. Note this should come after any other extensions in order to override the rules as appropriate.

"extends": [
    /*other extensions*/, 
    "prettier"                      // Turns off conflicting eslint rules.  
]             

As per their documentation, it sounds the recommended extension that comes with the prettier plugin actually takes care of everything for you, so you should be able to get away with just:

  extends: [
    // .. other extensions
    'plugin:prettier/recommended',
  ]

https://github.com/prettier/eslint-plugin-prettier

Also, in case third-party plugins come with their own rules that may conflict with prettier, you used to have to add "prettier/that-plugin" - "prettier/react" in your case for instance - to the list of plugins in order to tell eslint to defer to prettier for these non-standard rules as relevant as well. But this no longer seems required.

Answer from IAmDranged on Stack Overflow
🌐
DhiWise
dhiwise.com › post › react-code-formatting-made-easy-a-journey-with-prettier
Exploring the World of prettier: An Opinionated React Formatter
July 22, 2024 - Prettier is an opinionated react formatter that supports variety of languages, including JavaScript, which is the backbone of any React application.
🌐
Prettier
prettier.io
Prettier · Opinionated Code Formatter · Prettier
styled-components 💅 · Lightning Web Components (LWC)
Discussions

reactjs - How to format React Project in VSCode with ESLint, Prettier, and Flow ending tag without {" "} - Stack Overflow
I have a React project created with the Create React App: https://reactjs.org/docs/create-a-new-react-app.html#create-react-app · I have my project set up with ESLint, Prettier, and Flow using VSCode as my editor. More on stackoverflow.com
🌐 stackoverflow.com
How do you use eslint and prettier to your react project
install both plugins for vscode itself install prettier and eslint as dev dependencies install eslint-config-prettier create a .eslintrc.js and begin configuring.... here is where most of the issues arise as its a jungle of information out there on how to do that properly if you want to skip the entire ordeal, I built my own eslint config which supports both out of the box without any setup needed if youre happy with the defaults. More on reddit.com
🌐 r/reactjs
15
9
November 14, 2020
Prettier: Single Attribute Per Line
Prettier will only switch to one attribute per line if you approach the target print width. You can increase the print width to let more tags stay on one line, but Prettier doesn't really want you to adjust what it does. From their policy page: Prettier is not a kitchen-sink code formatter that attempts to print your code in any way you wish. It is opinionated. Quoting the Why Prettier? page: By far the biggest reason for adopting Prettier is to stop all the ongoing debates over styles. More on reddit.com
🌐 r/reactjs
2
0
April 12, 2022
What eslint prettier config do u use?

Heres the tooling/linting/formatting guide I wrote for the company I work for...

https://signal-noise.github.io/rfcs/text/0002-tooling-linting-formatting

May be marginally out-of-date.

More on reddit.com
🌐 r/reactjs
8
4
January 5, 2019
🌐
Medium
rimazmohommed523.medium.com › react-102-configuring-code-formatting-using-prettier-eslint-husky-f207f1bcebed
React 102 : Configuring code formatting using Prettier, ESLint & Husky | by Rimaz Mohommed | Medium
July 14, 2023 - In this article I’ll be diving into setting up pettier, eslint and husky for configuting the code formatting rules for your react js…
🌐
GitHub
gist.github.com › karpolan › 2c573b5767bc9b65db9936c7fad4daac
Prettier config for React App · GitHub
Prettier config for React App. GitHub Gist: instantly share code, notes, and snippets.
🌐
DEV Community
dev.to › knowankit › setup-eslint-and-prettier-in-react-app-357b
Setup ESLINT and PRETTIER in React app - DEV Community
September 26, 2021 - eslint-plugin-prettier - Runs Prettier as an ESLint rule · After installing above, make changes to .eslintrc file. "extends": ["eslint:recommended", "plugin:react/recommended", "plugin:prettier/recommended"]
Find elsewhere
🌐
Holt
react-v8.holt.courses › lessons › js-tools › prettier
Prettier – Complete Intro to React v8
Prettier is a really fancy pretty printer. It takes the code you write, breaks it down in to an abstract syntax tree (AST) which is just a representation of your code. It then takes that AST, throws away all of your code style you made and prints it back out using a predefined style.
🌐
Prettier
prettier.io › docs › options
Options · Prettier
Note that Prettier never unquotes numeric property names in Angular expressions, TypeScript, and Flow because the distinction between string and numeric keys is significant in these languages. See: Angular, TypeScript, Flow.
🌐
npm
npmjs.com › package › prettier
prettier - npm
January 21, 2026 - Prettier is an opinionated code formatter. Latest version: 3.8.1, last published: 2 months ago. Start using prettier in your project by running `npm i prettier`. There are 20167 other projects in the npm registry using prettier.
      » npm install prettier
    
Published   Jan 21, 2026
Version   3.8.1
Author   James Long
🌐
GitHub
github.com › prettier › prettier
GitHub - prettier/prettier: Prettier is an opinionated code formatter. · GitHub
Prettier can be run in your editor on-save, in a pre-commit hook, or in CI environments to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!
Starred by 51.8K users
Forked by 4.7K users
Languages   JavaScript 83.3% | TypeScript 6.2% | CSS 3.0% | HTML 3.0% | SCSS 1.5% | Less 1.0%
🌐
Medium
medium.com › @crbodarya05 › data-how-to-set-up-prettier-in-a-react-app-the-right-way-f5fe45d40bf4
Set Up Prettier in React (Complete Beginner Guide) | Medium
April 7, 2025 - Learn how to set up Prettier in your React app the right way. Includes installation, config, VS Code integration, and formatting tips for cleaner code.
🌐
DEV Community
dev.to › tsamaya › eslint-and-prettier-configuration-for-react-project-2gij
ESLint and Prettier configuration for React project - DEV Community
March 21, 2023 - Time to update the .eslintrc.js file, adding the prettier recommended plugin · extends: [ 'plugin:react/recommended', 'airbnb', 'plugin:prettier/recommended', ],
🌐
Prettier
prettier.io › docs › configuration
Configuration File · Prettier
Prettier intentionally doesn’t support any kind of global configuration. This is to make sure that when a project is copied to another computer, Prettier’s behavior stays the same.
🌐
Imaginary Cloud
imaginarycloud.com › blog › how-to-configure-eslint-prettier-in-react
How to configure ESLint and Prettier in React
On one hand, ESLint is responsible for checking against programming errors, on the other hand, we have Prettier an opinionated code formatter capable of finding any stylistic errors. It comes with some code style standards and is also easy to configure. It's easy to integrate with ESLint and has Code Editor extensions that can format the code on save! ... At Imaginary Cloud we develop React projects for our frontend rich applications so it became important to automate as much as possible the development process with proper tools in place.
🌐
Medium
zakimohammed.medium.com › react-prettier-eslint-configuration-22bf2cd77127
React Prettier ESLint Configuration | by Shaikh Zaki Mohammed | Medium
April 7, 2024 - React Prettier ESLint Configuration Soul pretty but code prettier. We now run by this quote, to maintain our code formatting top notch. Thanks to Prettier to take away this burden from the dev …
🌐
Prettier
prettier.io › docs
What is Prettier? · Prettier
Prettier enforces a consistent code style (i.e.
🌐
swyx
swyx.io › prettier-eslint-react
How To Add Prettier and ESLint Automation to a React Codebase
May 25, 2021 - Prettier doesn’t always do what you mean and ESLint checks things that Prettier doesn’t. For historical reasons, this codebase doesn’t use TypeScript, don’t @ me, my love for TypeScript is well documented. yarn add -D eslint eslint-plugin-react husky lint-staged prettier # or npm i -D eslint eslint-plugin-react husky lint-staged prettier