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
eslint --print-config no longer works when given a directory #11874
eslint --print-config no longer works when given a directory #11874
Comments
Hey @francoism90 , thanks for the issue. Where does your Also, can you install ESLint v5 and try it again to let us know whether it's a bug in v6 or not? |
@g-plane Downgrading to Eslint v5 fixes this issue:
The configuration file is located at It seems the upper directory is used instead of the project's root. |
How about your |
@g-plane |
It seems that I can't reproduce this on my PC (Windows 10). |
@g-plane This is on Linux, path lookup may differ. |
For the record, this also happens when upgrading to v6, creating a new |
I wonder if this is an error message confusing because Does the error disappear after you remove vue related settings? |
@mysticatea Unfortunately no:
|
I have a similar problem, despite having proper packages in place:
|
I can reproduce on Windows here. In my case, running From the error message (and as shown above), it looks like eslint --print-config is starting from the parent of the specified directory: if I run |
Does this issue occur when you actually lint a file, or only when using |
@mensfeld I think the error you're encountering might have a different cause -- feel free to open a new issue for it or stop by in the Gitter chat. |
I can reproduce this issue as it relates to |
Actually, it seems like the issue is that @mysticatea Do you think this is worth fixing? With upcoming changes to |
I see. I think a better message is useful. If a directory path was given with |
fwiw, I think In practice (and looking through github's search), I suspect most usages are coming from people using eslint-config-prettier, due to e.g. https://github.com/prettier/eslint-config-prettier#cli-helper-tool. |
@not-an-aardvark This works fine:
I don't know if this helps:
Thanks for taking a look, don't know if this may cause issues, I just use this command for testing the config as can been in the prettier example. |
@not-an-aardvark it seems it's related directly to lack of support of the new es linter from the airbnb package maintainers: airbnb/javascript#2036 |
Since v4.1.0, ESLint has supported glob-based configuration. So And the document says requiring a file path and print the configuration for linting the given file. I think that the solution is a better error message when a directory path was given. |
I think there might be a few usages of I need to update that section. |
Plus we were using it weirdly before. See: eslint/eslint#11874
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What did you expect to happen?
Printing config
What actually happened? Please include the actual, raw output from ESLint.
Looks in upper path instead of current.
Project path is located at
/home/user/www/project
.Are you willing to submit a pull request to fix this bug?
No, sorry.
The text was updated successfully, but these errors were encountered: