Closed JaKXz closed 4 years ago
Yes, PR is welcome! (it should use lint-staged underneath so partially staged files are supported)
Similar --changed
and --since
flags has been introduced in 13.0.0
For now you can use lint-staged to get your behavior
Would --changed --since HEAD~1
Do the trick?
prettier-standard --changed
is enough, but it would also format non-staged changes.
if you want to format just staged changes please use lint-staged for now
Also remember that prettier currently has some servere issues with range formatting:
Because of this --since HEAD
should be currently more stable than --changes
, but it formats whole contents of changed files, not only changed lines.
It would be cool if there was a
--staged
option, like https://github.com/azz/pretty-quick so I don't have to add a pre-commit hook to a project that the team doesn't want hooks on.