I'm working on react project which has integrated eslint. It works great and if I try commit code that is not compatible with eslint i get errors and commit is stopped. Although when I don't have any errors I just get message "running eslint...". I tried waiting, but after an hour I decided to break by ctrl-c and commit with --no-verify flag. It happens both in vscode on Ubuntu as in Intellij on Windows. Has any encountered this problem before and know how to fix it?
Asked
Active
Viewed 3,142 times
1
-
2Can you look in the `.git/hooks` directory and find the relevant hook (probably `pre-commit`) and include its contents as a code block in your question? – bk2204 May 29 '20 at 21:25
-
4Try to add the `--debug` flag to the eslint command ran by the git hook. It should give you more info on what's going on. – Scalpweb May 29 '20 at 21:30
2 Answers
4
Have encountered the same issue and the solution for me was to remove the build directory and it works

Dani
- 745
- 7
- 12
-
2Yup, looks like ESLint started processing the `build` directory as well. An alternative to always deleting it is to create a `.eslintignore` file with `build/` inside. – geisterfurz007 Feb 02 '22 at 07:47
-
1
2
It turns out that storybook_static
build files will too make eslint hang forever :/
Just remove it too.

Felipe N Moura
- 1,367
- 11
- 13
-
1This one saves. Basically the answer was to remove build folder. But I missed this folder, and this comment saves me. – Adharsh M May 03 '23 at 02:58