-
-
Notifications
You must be signed in to change notification settings - Fork 289
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
XO --fix on pre-commit hook without blocking commit #494
Comments
You can probably do it with Bash: |
By the way, I can confirm that the |
Doesn’t seem to work for me on Mac 😅 |
This comment has been minimized.
This comment has been minimized.
Ok, so lint-staged v11.2.0 and husky v7 will take:
And transform it into:
I haven't investigated exactly how it may respond to seeing I did suggest the idea of allowing file replacements, which could allow us to do something like this:
In the short term, you could create a script:
In package.json scripts:
Inside
If you have small enough commits, you hopefully won't have memory issues when running XO pre-commit. If you are having memory issues elsewhere, follow: #599 (comment) |
This comment has been minimized.
This comment has been minimized.
Ok, turns out that didn't quite work that well. This works:
|
Nice idea. https://stackoverflow.com/a/24538676/35946 is an elegant IIFE-ish shell solution, too. |
Hello!
My issue is the following:
I have sucessfully added
xo --fix
to my pre-commit hooks and it's fixing all autofixable issues, but erroring out with non-autofixable ones, we're in the middle of integrating it so it's a gradual rollout, is there a way to run XO in silent mode so that it shows the error but doesn't block the commit?I'm using Husky and lint-staged to run the hook.
The text was updated successfully, but these errors were encountered: