Skip to content

Instantly share code, notes, and snippets.

@patmigliaccio
Last active September 22, 2020 20:41
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save patmigliaccio/55d2a1456a778a0076aff91957bcb89b to your computer and use it in GitHub Desktop.
updates entire git repo history with prettier based on .prettierrc
#!/bin/sh
# Reference: https://medium.com/millennial-falcon-technology/reformatting-your-code-base-using-prettier-or-eslint-without-destroying-git-history-35052f3d853e
git filter-branch --tree-filter 'prettier --config ../../.prettierrc --write "src/{app,environments,assets}/**/*{.ts,.js,.json,.css,.scss}" || echo "formatting error"' -- --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment