Run prettier to format files that are changed in Git.
If we want to only format changed files for whatever reason, this quick command makes that possible. You will have to change it according to your needs, depending on which files you want.
npx prettier --write $(git diff --name-only --diff-filter d | grep '.ts$' | xargs)
In this case, it is only working on
.ts files. But you can change it to whatever suits your needs. Found the script here.