Background
If you are like me, you have the Prettier extension installed, enabled formatting on save, got frustrated when your code kept...
For further actions, you may consider blocking this person and/or reporting abuse
Use without installing
If you don't have Prettier installed globally or in a project, you can still download and run it on a project. This won't install it.
That will use the default options plus any overrides you've set in Prettier configs.
More info on how to use Prettier CLI
michaelcurrin.github.io/dev-cheats...
The prettier extension is editor-specific. For an editor-agnostic solution, you can create a prettier git pre-commit hook pretty easily using pretty-quick and Husky.
Really cool. I didn't know about either of those tools. Thanks for sharing!
Sure thing! This is my preferred way to use prettier.
If you want keep it that shorter, you can remove options which are already the same as Prettier defaults. Like semi and quotes.
Also I noticed your style of indent 4 and using tabs is not the prevailing style I've noticed in the JS community. So if anyone contributes to your repo and that don't have your Prettier config, they may conflict with you.
Another approach based on Sharing configuration section of this doc is to publish your config as a NPM package, even if it's only on GitHub. Then you can install your own package in all your own projects. This means that you and anyone else who works on your projects can share the same config file.
I want to add a list of all options that Prettier allows. And if you like the default options, you can keep your config light or non existent by relying on those.
prettier.io/docs/en/options.html
Thanks for linking this :)
Clever! I'm definitely going to give this a try. Thanks for sharing!
I use Standard JS.
Really cool. Thanks for sharing!
Good post!