Skip to content

Instantly share code, notes, and snippets.

@davidtingsu
Last active January 11, 2024 08:48
Show Gist options
  • Save davidtingsu/58eb10450d04528623d2fd40fc4ad8fc to your computer and use it in GitHub Desktop.
Save davidtingsu/58eb10450d04528623d2fd40fc4ad8fc to your computer and use it in GitHub Desktop.
fix flles in git diff feature branch against main jsx|.tsx|.js$|.ts$ with prettier
# run prettier against the changed files between your branch and main
# tested on macosx
git diff --name-status `git merge-base HEAD main` HEAD | awk '{print $2}' | grep -E '.jsx|.tsx|.js$|.ts$' | xargs npx prettier --write
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment