"Bailing": Failing when `prettier --write` (or similar) fixes a file? (No "git add" task)
See original GitHub issueDescription
I’m trying to replace pretty-quick
(automated with a Git pre-commit hook) with this tool. The former has the --bail
behavior which allows me to review any changes done by Prettier by using git diff
, before adding them myself (so no "git add"
task in lint-staged
config) and trying to commit again. I haven’t found a way to set this up 🙁 Is it possible?
Environment
- OS: macOS Catalina
- Node.js: v10.16.3
lint-staged
: 9.4.3
Issue Analytics
- State:
- Created 4 years ago
- Reactions:3
- Comments:14 (4 by maintainers)
Top Results From Across the Web
Pre-commit Hook - Prettier
You can use Prettier with a pre-commit tool. This can re-format your files that are marked as “staged” via `git add` before you...
Read more >Code style issues found in the above file(s). Forgot to run ...
I have this problem when I try to check style with prettier --check. Code style issues found in the above file(s). Forgot to...
Read more >Using lint-staged, husky, and pre-commit hooks to fail fast and ...
Let's look at using lint-staged and husky to fail earlier and faster. ... either fixing the error or using the --no-verify commit flag....
Read more >ESLint and Prettier with Husky git hooks - YouTube
Using eslint and the prettier formatter are considered best practices at this point, especially for projects that will have lot's of ...
Read more >How to add ESlint, Prettier, and Husky (Git Hook) in React JS ...
Today we are going to fix the problem together. Let's enforce a coding style using eslint and format our code automatically using prettier!...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay that actually make sense to me now. Let’s try to keep changes unstated and exit with a special code?
In v10 this is easy, because we automatically do the
git add .
step. With the--bail
flag we would just fail at that point instead of continuing. I can add this if you’re fine with it, @okonet.