Skip to content
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

6.0.0-alpha.1 tries to process configuration files in ignored directories #11724

Closed
Standard8 opened this issue May 15, 2019 · 3 comments
Closed
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion auto closed The bot closed this issue question This issue asks a question about ESLint

Comments

@Standard8
Copy link
Contributor

Tell us about your environment

  • ESLint Version: 6.0.0-alpha.1
  • Node Version: 8.16.0
  • npm Version: 6.4.1

What parser (default, Babel-ESLint, etc.) are you using?
default

Please show your full configuration:

Configuration

Top-level .eslintrc.js

module.exports = {
    "parserOptions": {
        "ecmaVersion": 2017
    },
};

Top-level .eslintignore

test/**

For test/.eslintrc.js

module.exports = {
  "extends": [
    "prettier",
  ]
};

What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.

No source code necessary (I had an index.js that was commented out).

./node_modules/.bin/eslint .

What did you expect to happen?

No errors

What actually happened? Please include the actual, raw output from ESLint.

$ ./node_modules/.bin/eslint .

Oops! Something went wrong! :(

ESLint: 6.0.0-alpha.1.
ESLint couldn't find the config "prettier" to extend from. Please check that the name of the config is correct.

Normal files within ignored directories are correctly ignored, but it seems that the .eslintrc.js files are still processed.

Are you willing to submit a pull request to fix this bug?
No

@Standard8 Standard8 added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels May 15, 2019
@mysticatea mysticatea added core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels May 15, 2019
@mysticatea
Copy link
Member

mysticatea commented May 15, 2019

Thank you for your report.

Actually, this is intentional behavior because we change the order of loading; now ESLint loads config files before target files. The purpose of this change is to configure target files with config files. For example, eslint/rfcs#20, eslint/rfcs#22. With either proposal, we can add the .eslintrc.js as a lint target with the config file. ESLint needs to load config files when ESLint entered into directories while traversing in order to realize such a feature.

If you used test instead of test/** to ignore the directory, we lose the ability to unignore any files in the directory with negative file patterns, so ESLint doesn't enter the directory. (Actually, test/** means to ignore all files in the test directory, but not the test directory itself.)

@mysticatea mysticatea added question This issue asks a question about ESLint and removed bug ESLint is working incorrectly core Relates to ESLint's core APIs and features evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels May 15, 2019
@Standard8
Copy link
Contributor Author

Ok, I think that makes sense, thank you for the response.

If nothing else, I'd suggest this is flagged in the breaking changes, and maybe also adding an example to the configuration section around ignoring files. There's probably not too many people with sub-directory imports in this fashion, but the solution wasn't immediately obvious to me.

@eslint-deprecated eslint-deprecated bot added the auto closed The bot closed this issue label Jun 15, 2019
@eslint-deprecated
Copy link

It looks like the conversation is stalled here. As this is a question rather
than an action item, I'm closing the issue. If you still need help, please send
a message to our mailing list or
chatroom. Thanks!
[//]: # (auto-close)

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Dec 13, 2019
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Dec 13, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion auto closed The bot closed this issue question This issue asks a question about ESLint
Projects
None yet
Development

No branches or pull requests

2 participants