-
-
Notifications
You must be signed in to change notification settings - Fork 412
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
Ignoring .eslintrc.json #696
Comments
It seems the git directory is If there is an issue here, it might be that eslint is running in another directory and thus not finding the configuration file. |
I wonder if this is the same issue as #677 |
+1 I am also experiencing this with husky and lint-staged with an |
did anyone manage to resolve this? |
I don't think this is an issue with lint-staged but with eslint itself. see eslint/eslint#9977 From what i gather lint-staged (or whatever other mechanism you can use) tells eslint to run over whatever files match the glob pattern, eslint takes that as an explicit command. This is different to running eslint through the command line were it applies any eslint ignore file and rules. |
Same issue with .eslintrc.js - lint-staged does not read the config |
I tested this hypothesis and here's what I found. Running the command directly on the file i.e. Interestingly enough, running
Still trying to figure out why it's erroring out. |
I am having the same error.
But trying {
"*.{js,jsx,ts,tsx}": ["eslint --fix"]
}
I also tried suggestion in this other issue #677 |
I wonder if this helps: #1081 |
I figured the issue -> it's a path issue. To solve it, I forced all path to the exe with the prefix "./node_modules/.bin/eslint" it worked. |
Description
When lint-staged is run the .eslintrc.json file is ignored. Running eslint from the command line works fine, but when eslint is run via husky/lint-staged it does not yield the same result as it ignores my .eslintrc.json file
Steps to reproduce
Try to git commit changes
Debug Logs
expand to view
Environment
lint-staged
: v9.2.5The text was updated successfully, but these errors were encountered: