Skip to content

Instantly share code, notes, and snippets.

@oookli
Forked from Mohamed3on/batchPrettier.md
Created February 25, 2021 10:45
Show Gist options
  • Select an option

  • Save oookli/c86f87b56eff4c69786c165cc4c8cfbb to your computer and use it in GitHub Desktop.

Select an option

Save oookli/c86f87b56eff4c69786c165cc4c8cfbb to your computer and use it in GitHub Desktop.
Run prettier on all JS files in a directory
  1. Install prettier
  2. Make a .prettierignore file, and add directories you'd like prettier to not format, for example: **/node_modules
  3. Run prettier --write "**/*.js" *Don't forget the quotes.
  4. Optional: if you want to format JSON/SCSS files too, replace js with json/scss.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment