-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
auto load local .eslintrc #7088
Conversation
It should also be configurable somehow IMO, because a lot of projects I work on/I've seen keep the |
This works well, and is super-needed, but I think it belongs in the general Javascript layer where eslint lives. Also, I don't really know why Flycheck cares where the config is? Eslint will autodetect configs based on the directory structure and combine rules from ancestor .eslintrc files, so ideally we should just be able to give eslint the path of the file being checked and let it handle config discovery. It seems weird to disable the checker because Flycheck can't find the config but the checker itself can. This might be a Flycheck issue. EDIT: See
@codefalling I'd be willing to assist with getting this resolved and into master, as my day job requires eslint :) |
(progn | ||
(message rc-path) | ||
(setq flycheck-eslintrc rc-path))))) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to the javascript
layer.
@@ -51,7 +59,7 @@ | |||
(setq-local flycheck-javascript-eslint-executable eslint))) | |||
|
|||
(add-hook 'react-mode-hook #'react/use-eslint-from-node-modules) | |||
|
|||
(add-hook 'react-mode-hook #'react/use-eslintrc-from-project-root) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move to the javascript
layer.
Looked into this more, and
So really, we shouldn't ever need to explicitly tell eslint or flycheck where the .eslintrc is, as long as it is somewhere in a parent folder or the project root, which is where eslint expects to find them. Comments from @lunaryorn in the flycheck gitter:
See also the release notes for the latest flycheck release that confim: https://github.com/flycheck/flycheck/releases/tag/30 I updated flycheck, removed some old, bad .eslintrc config files from my folder tree, verified that running |
Thank you for that @bleggett! |
@TheBB -- I'm pretty strong that this belongs in the |
So this PR is not needed? If so, please merge it and then correct it in a new commit. |
Shouldn't this be on the javascript layer though @syl20bnr?
|
As @bleggett said, this PR is not needed. Should we close this? |
Since it's in the wrong layer...yeah. |
Closing then since not needed, no matter what layer it's in. |
Load
.eslintrc
from project's root if existed.