Install prettier locally to your project:
yarn add prettier
Then, add a new script to package.json:
{
"scripts": {
"prettier": "prettier --write --use-tabs --single-quote --no-semi --no-bracket-spacing 'src/*/**.js'"
}
}
Remember to change the path at the end to match where your JavaScript files are.
Now you can always run yarn prettier
and it'll format and overwrite your files. Pretty and all.