Answer the question
In order to leave comments, you need to log in
How to set up eslint to work with git-hook pre-commit (checking eslint manually works)?
Seems like a simple setup. I do everything according to the instructions. But doesn't work.
There is a folder with a git repository that contains the project
test3/
—.git
—project1/
——node_modules/
——src/
———js/
————1.js
——.eslintrc.json
npm install --save-dev eslint-config-standard eslint-plugin-standard eslint-plugin-promise eslint-plugin-import eslint-plugin-node
npm install --save-dev eslint
{ "extends": "standard"}
./node_modules/.bin/eslint src/js
path="$(git rev-parse --show-toplevel)"
"$path/project1/node_modules/.bin/eslint" "$path/project1/src/js/"
[[email protected] project1 (master +)]$ git commit -m "T"
Oops! Something went wrong! :(
ESLint: 6.6.0.
ESLint couldn't find the plugin "eslint-plugin-import".
(The package "eslint-plugin-import" was not found when loaded as a Node module from the directory "/Users/notebook/Documents/Projects/test3".)
It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
npm install [email protected] --save-dev
The plugin "eslint-plugin-import" was referenced from the config file in "project1/.eslintrc.json » eslint-config-standard".
If you still can't figure out the problem, please stop by https://gitter.im/eslint/eslint to chat with the team.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question