There's a great package called prettier-eslint that we've used at work before. It will format using prettier and then run eslint --fix on your code. We liked it, give it a try!

Answer from Adam LeBlanc on Stack Overflow
🌐
Prettier
prettier.io › docs › cli
CLI · Prettier
Prettier CLI will ignore files located in node_modules directory. To opt out from this behavior, use --with-node-modules flag. This rewrites all processed files in place. This is comparable to the eslint --fix workflow.
🌐
GitHub
github.com › prettier › prettier › issues › 6280
How do I use the CLI to fix all files? · Issue #6280 · prettier/prettier
July 9, 2019 - If I try prettier --check "*" or prettier --check NOTHING then Prettier seems to completely ignore the .prettierignore file.
Author   octogonz
Discussions

How to get ESLint --fix to also run prettier --write
Right now I need to do prettier --write && eslint --fix and I was hoping I could just run the one command. More on stackoverflow.com
🌐 stackoverflow.com
eslint - How can I solve the prettier/prettier problem - Stack Overflow
I'm using nuxtjs, and I installed eslint on my project, and upon using npm run dev, I get a bombardment of errors. How can I fix this: ... This error is related to Windows Line endings being different from Unix ones. Try running npx prettier --write . on your project's directory. This command will ... More on stackoverflow.com
🌐 stackoverflow.com
A better Prettier CLI and config file
After a big find-and-replace refactor in src/components you can run prettier format src/components to fix formatting (without having to run on the entire project). ... Note: I think we should ditch built-in support for globs altogether. They’re not needed! If you need globs for a one-off command, ... More on github.com
🌐 github.com
26
November 30, 2019
node.js - prettier command not working even though prettier is in devDependancies - Stack Overflow
Installing a module that includes a CLI program like prettier, nodemon, etc., will place the program in node_modules/.bin. Your terminal shell does not know to look in this folder when you run a command. Type echo $PATH in your terminal to see a list of the folders that are checked when you ... More on stackoverflow.com
🌐 stackoverflow.com
🌐
GitHub
github.com › prettier › prettier-eslint
GitHub - prettier/prettier-eslint: Code `prettier` `eslint --fix` Formatted Code :sparkles: · GitHub
This formats your code via prettier, and then passes the result of that to eslint --fix.
Starred by 4.1K users
Forked by 175 users
Languages   TypeScript 92.9% | JavaScript 7.1%
🌐
LocalUsr
localusr.com › posts › 2022 › 01 › 3-how-to-fix-prettier-code-style-issues
How to Fix Prettier Code Style Issues :: LocalUsr
This commands will perform the check on the project files based on the config of prettier. It will try to fix the errors and those that it can’t will be shown in the final output.
🌐
Fishtank
getfishtank.com › insights › running-prettier-from-the-command-line
Running Prettier from the Command Line | Fishtank
March 21, 2023 - Now format all files with Prettier by running - npm run format in your terminal. This command will pick up “format” inside “script” in your project’s package.
Find elsewhere
🌐
freeCodeCamp
freecodecamp.org › news › dont-just-lint-your-code-fix-it-with-prettier
Don’t just lint your code - fix it with Prettier
November 6, 2019 - If you’ve followed along so far, we now have two commands: lint: which will check your code for you and tell you what's wrong · format: will automatically try to fix the problems for you · When using these in practice, your best bet is to ...
🌐
Prettier
prettier.io › docs › install
Install · Prettier
Formatting from the command line is a good way to get started, but you get the most from Prettier by running it from your editor, either via a keyboard shortcut or automatically whenever you save a file. When a line has gotten so long while coding that it won’t fit your screen, just hit a key and watch it magically be wrapped into multiple lines! Or when you paste some code and the indentation gets all messed up, let Prettier fix ...
🌐
GitHub
github.com › prettier › prettier-eslint-cli
GitHub - prettier/prettier-eslint-cli: CLI for prettier-eslint · GitHub
If you provide the argument --prettier-last, it will run eslint --fix first, then prettier. This allows you to use eslint to look for bugs and/or bad practices, and use prettier to enforce code style. prettier-eslint-cli also supports the same ...
Starred by 548 users
Forked by 69 users
Languages   JavaScript
🌐
npm
npmjs.com › package › prettier-eslint-cli
prettier-eslint-cli - npm
October 14, 2023 - If you provide the argument --prettier-last, it will run eslint --fix first, then prettier. This allows you to use eslint to look for bugs and/or bad practices, and use prettier to enforce code style. prettier-eslint-cli also supports the same ...
      » npm install prettier-eslint-cli
    
Published   Oct 14, 2023
Version   8.0.1
Author   Kent C. Dodds
🌐
LogRocket
blog.logrocket.com › home › using prettier and eslint for javascript formatting
Using Prettier and ESLint for JavaScript formatting - LogRocket Blog
October 22, 2024 - Now, you can run the npm run format command to format and fix all your code in one go. All the major code editors have extensions for ESLint and Prettier.
🌐
Rushjs
rushjs.io › pages › maintainer › enabling_prettier
Enabling Prettier | Rush
July 5, 2022 - # Install prettier so you can invoke it manually npm install --global prettier # Run these commands from your repo root, since "." below refers to the current folder cd my-repo # See what files Prettier will operate on; use this to tune your ...
🌐
Prettier
prettier.io › blog › 2023 › 11 › 30 › cli-deep-dive
Prettier's CLI: A Performance Deep Dive · Prettier
November 30, 2023 - prettier packages --check # 29s prettier packages --check --cache # 20s prettier@next packages --check --no-cache --no-parallel # 7.3s prettier@next packages --check --no-cache # 5.5s prettier@next packages --check # 1.3s · By default times for the same command go from ~29s to ~1.3s, for a ~22x speedup.
🌐
Prettier
prettier.io › docs › ignore
Ignoring Code · Prettier
It’s recommended to have a .prettierignore in your project! This way you can run prettier --write . to make sure that everything is formatted (without mangling files you don’t want, or choking on generated files).
🌐
GitConnected
levelup.gitconnected.com › how-to-format-all-files-in-a-directory-with-prettier-5f0ff5f4ffb2
How To Format All Files in a Directory with Prettier | by Dr. Derek Austin 🥳 | Level Up Coding
June 25, 2024 - Thankfully, it’s easy to fix the formatting in 5 seconds using Prettier. I usually just use Prettier from inside VS Code (using the prettier-vscode extension), so I was surprised by Prettier’s command line power.
🌐
GitHub
github.com › prettier › prettier › issues › 7073
A better Prettier CLI and config file · Issue #7073 · prettier/prettier
November 30, 2019 - After a big find-and-replace refactor in src/components you can run prettier format src/components to fix formatting (without having to run on the entire project). ... Note: I think we should ditch built-in support for globs altogether.
Author   lydell
🌐
DEV Community
dev.to › sophiabrandt › format-and-fix-all-files-with-prettier-and-eslint-recursively-1gld
Format And Fix All Files With Prettier And ESLint (Recursively) - DEV Community
November 6, 2019 - The problem: You have a bunch of ... with Prettier and ESLint. Why? You would like to make sure that ESLint analyzes your code for problematic patterns. You would like to have consistent formatting, and don't worry about code style while writing the code. In this post, I'll show you how to recursively fix and format all your JavaScript files with one command...