-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
How do I use the CLI to fix all files? #6280
Copy link
Copy link
Closed
Labels
locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:awaiting responseIssues that require answers to questions from maintainers before action can be takenIssues that require answers to questions from maintainers before action can be taken
Metadata
Metadata
Assignees
Labels
locked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.Please open a new issue and fill out the template instead of commenting.status:awaiting responseIssues that require answers to questions from maintainers before action can be takenIssues that require answers to questions from maintainers before action can be taken
I apologize if this is a stupid question.
We have a large monorepo containing lots of projects. We need to specify the exact set of paths to be processed by Prettier. It's not okay for Prettier to go trawling through random folders, rewriting files with no idea whether they are inputs or outputs.
The .prettierignore config file seems like the right way to do this. Well, actually we want to specify what DOES get processed, rather than what doesn't. But I can solve that by inverting the logic, something like this:
/.prettierignore
But now, how do I get Prettier to rewrite these files? The CLI docs show an example like this:
The
"{app,__{tests,mocks}__}/**/*.js"glob is redundant, because my .prettierignore file is already communicating this information.If I try
prettier --check "*"orprettier --check NOTHINGthen Prettier seems to completely ignore the .prettierignore file.The option
--config-precedence=file-overridelooks like a solution. It supposedly makes the config file take precedence over the CLI.But when I try
prettier --check --config-precedence=file-override NOTHING, it fails with this error:What am I doing wrong here? This seems like the most basic first step for adopting Prettier...