Skip to content

Instantly share code, notes, and snippets.

@ThePlenkov
Created November 13, 2024 14:15
Show Gist options
  • Save ThePlenkov/72a21cc72627b791e76ad9a1c62bed33 to your computer and use it in GitHub Desktop.
Save ThePlenkov/72a21cc72627b791e76ad9a1c62bed33 to your computer and use it in GitHub Desktop.
NX autoformatting on commit
# .husky/pre-commit
nx format:write --uncommitted
git update-index --again
@ThePlenkov
Copy link
Author

It works like a charm for me. It only formats what was touched (uncommited), but doesn't add new files into the index. So you commit only what was staged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment