Search code examples
giteslint

How to prevent eslint from blocking git commit?


I'm new to eslint and am using it to enforce coding style. However, when I write a TODO item into my code I get an eslint warning, alright that's fine. But, now when I try to git commit, it comes back with:

**** ESLint errors found :     
line 145, col 9, Warning - Unexpected 'todo' comment. (no-warning-comments)

How can I prevent eslint from blocking me from committing? I want it to still warn me about TODOs etc, but I would like to be able to commit my code as well.


Solution

  • You have a pre-commit hook.

    git commit --no-verify
    

    allows to avoid it once. Or you can remove it completely from .git/hooks.