Built-in support for pre-commit hooks #2750
kevinwolfcr
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello! I think it would be very helpful to have built-in support for running pre-commit hooks that checks code before applying a commit. For people like me, who likes abstracting as much as possible and reducing dependencies, could be very beneficial. Also, the Git Hooks documentation page would be more straightforward and offer a single alternative (and I personally think this aligns with Biome's philosophy of being an all-in-one toolchain.
My current setup
I currently use
simple-git-hooks
and set it up to runbun biome check --staged --apply --files-ignore-unknown=true --no-errors-on-unmatched && git update-index --again
on pre-commit.This is how my current package.json looks like:
My ideal setup
If this idea gets accepted, the package.json will look like this:
Proposed solution
biome.json
file:Note
That
precommit
property could be extended maybe with a configuration object depending on the user needs?Tip
By putting this into the configuration file, then users could easily share and abstract their configs and have the same behavior on their different projects
@biomejs/biome
's postinstall script.Thanks!
Beta Was this translation helpful? Give feedback.
All reactions