In addition to running prettier from the command line (prettier --write), checking formatting in ci, and running prettier from your editor, many people like to run prettier as a pre-commit hook as well. Prettier is going to do the painstaking work of reprinting it like that for you: By default, prettier automatically infers which parser to use based on the input file extension.
Combined with overrides you can teach prettier how to parse files it does not recognize. Prettier can restrict itself to only format files that contain a special comment, called a pragma, at the top of the file. This is very useful when gradually transitioning large, unformatted codebases to prettier.
To get the most out of prettier, it’s recommended to run it from your editor. If your editor does not support prettier, you can instead run prettier with a file watcher. So why choose the “prettier style guide” over any other random style guide?
Because prettier is the only “style guide” that is fully automatic. Even if prettier does not format all code 100% the way you’d like,. Test your code formatting with prettier's online playground, which allows you to experiment with different options and see real-time results.
Prettier is an opinionated code formatter. Prettier alleviates the need for this whole category of rules! Prettier is going to reprint the entire program from scratch in a consistent way, so it’s not possible for the programmer to make a mistake there.