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
Extends resolver does not work correctly when .eslintrc and eslint are placed in different modules with npm@2 (or, not flat) #6338
Comments
The problem here is that dependencies are resolved by ESLint itself, not by shareable config. So in the case your shareable config |
Weird. eslint/tests/lib/config/config-file.js Lines 629 to 643 in 977cdd5
|
@mysticatea, it's not only about chaining but running @ilyavolodin, |
I got it. |
We don't distinguish if ESLint is installed globally or not (there's no proven way to do that). IIRC, what we did was resolve from the config file if it wasn't in the home directory ( What's the relationship between this issue and #6358? |
It was my misunderstanding. |
per eslint/eslint#6338 ESLint needs to be a peerDependency, in order for `extends` clauses to work properly.
Unfortunately, it looks like consensus couldn't be reached on this issue and so I'm closing it. While we wish we'd be able to accommodate everyone's requests, we do need to prioritize. We've found that issues failing to reach consensus after 21 days tend never to reach consensus, and as such, we close those issues. This doesn't mean the idea isn't interesting, just that it's not something the team can commit to. |
What version of ESLint are you using?
2.11.1
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
I have created a CLI that runs eslint and now using it in various projects. The actual eslint dependency is there, but the
.eslintrc
is inside the projects that use this CLI.In addition, I have another module that inherits from
xo
configs and extends them. The structure looks like this:What actually happened? Please include the actual, raw output from ESLint.
It's probably worth to mention that I'm using
npm@2
, so my dependencies (as you can see) are not flatten. It would work if I usenpm@3
(or, say,npm dedupe
) due tolookupPaths
.I have started to investigate that a little bit, and it looks like there's a problem with resolving the
baseDir
.projectPath
is related to my CLI pathmy-repo/node_modules/my-cli/node_modules
(it takes the place where eslint was started and go back../../../
), andconfigFilePath
ismy-repo/.eslintrc
; then things are getting worse becausepathIsInside(..)
equals to false andprojectPath
is returned.It resolves
eslint-config-custom
successfully as it's located insidemy-repo/node_modules
and it's a part of thelookupPaths
.The text was updated successfully, but these errors were encountered: