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

Eslint broke plugin resolution from 5 version #11889

Closed
Delagen opened this issue Jun 24, 2019 · 12 comments
Closed

Eslint broke plugin resolution from 5 version #11889

Delagen opened this issue Jun 24, 2019 · 12 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion question This issue asks a question about ESLint

Comments

@Delagen
Copy link

Delagen commented Jun 24, 2019

Tell us about your environment

  • ESLint Version: 6.0
  • Node Version: 12.4.0
  • npm Version: 6.9.0

What parser (default, Babel-ESLint, etc.) are you using? @typescript-eslint/parser

Please show your full configuration:

Configuration
...
"plugins": [
		"node"
	],
...

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

I have shared package which contains all the dependencies (plugins) and call eslint parser via CLIEngine

const linter = new CLIEngine(options);
invoked via runner

What did you expect to happen?
All works as expected

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

Failed to load eslint-plugin-node
https://github.com/eslint/eslint/blob/master/lib/cli-engine/config-array-factory.js#L870

Cause it contained in subpackage that calling this code? I think in broke many shared runners.

@Delagen Delagen added bug ESLint is working incorrectly triage An ESLint team member will look at this issue soon labels Jun 24, 2019
@mysticatea
Copy link
Member

Hi. How do you run eslint?

As the migration guide says, we have changed plugin resolution intentionally. Is this not related to your case?

@mysticatea mysticatea added 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 Jun 24, 2019
@Delagen
Copy link
Author

Delagen commented Jun 24, 2019

I resolved this via resolvePluginsRelativeTo option of CLIEngine.
But now has error Configured parser 'full path to @typescript-eslint\parser\dist\p
arser.js' was not found.

I called it from my shared package via Node.JS api.

main-package
|--node_modules
|     |--sharedPackage
|     |     |--node_modules
|     |     |     |--eslint
|     |     |     |--eslint-plugin....
|     |     |     |--@typescript-eslint/parser

@mysticatea mysticatea added question This issue asks a question about ESLint and removed bug ESLint is working incorrectly evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion labels Jun 24, 2019
@mysticatea
Copy link
Member

If it's an absolute path and the file existed, it should load successfully. Would you confirm the path is valid and exists?

@Delagen
Copy link
Author

Delagen commented Jun 24, 2019

Yes, path is valid and file exists. Tried to update parser to canary version, but no success

@mysticatea
Copy link
Member

Would you check the version of your @typescript-eslint/parser? 1.11.0 got supported ESLint 6.

@mysticatea
Copy link
Member

mysticatea commented Jun 24, 2019

Ah, sorry. You said canary.

Hmm. I'm not sure what it happened. If you provided a repro case, it will be helpful.

Delagen pushed a commit to Delagen/eslint-resolution-issue that referenced this issue Jun 24, 2019
@Delagen
Copy link
Author

Delagen commented Jun 24, 2019

@mysticatea
Copy link
Member

Ah, I see. Thank you for the repro repo!

This is related to Linter no longer tries to load missing parsers from the filesystem section. Linter class doesn't load parsers automatically. I'd like to recommend to use CLIEngine instead of Linter.

@Delagen
Copy link
Author

Delagen commented Jun 24, 2019

Thanks. Rewrote code to executeOnText of CLIEngine.
Any way to remove check rule for existense in disable comments?

@mysticatea
Copy link
Member

Unfortunately, there are no ways. Since #11742, ESLint validates directive comments stricter.

@Delagen
Copy link
Author

Delagen commented Jun 24, 2019

I use multi pass eslint with different configs and plugins. One for all js, second for client code with angular plugin, and etc. So common pass fail when found directive from specific plugin. Temporary silenced this error with filter by message text.

@mysticatea
Copy link
Member

Closing as answered. Thank you.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Dec 23, 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 23, 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 question This issue asks a question about ESLint
Projects
None yet
Development

No branches or pull requests

2 participants