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

Initialization Cannot Find Module #66

Closed
idkjs opened this issue Apr 18, 2017 · 6 comments
Closed

Initialization Cannot Find Module #66

idkjs opened this issue Apr 18, 2017 · 6 comments

Comments

@idkjs
Copy link

idkjs commented Apr 18, 2017

After installing and selecting eslint_d as eslint, webstorm throws error looking for the cli. There is no cli option in the package that i could tell. What am I missing here to get this to work with webstorm? Thank you.

screen shot 2017-04-18 at 13 16 56

screen shot 2017-04-18 at 13 20 53

@mantoni
Copy link
Owner

mantoni commented Apr 18, 2017

The newest version of WebStorm seems to have a new eslint integration. It's unclear atm whether eslint_d still improves performance when used with that version. If you could try to find out more I would be thankful as I'm not using WebStorm myself.

@idkjs
Copy link
Author

idkjs commented Apr 19, 2017

What do you want to know? If its faster with or without? I guess I cant really do anything if there isnt the cli file that webstorm is looking for, right? Happy to help if you show me how. Thanks for taking the time to respond.

@mantoni
Copy link
Owner

mantoni commented Apr 19, 2017

There have been recent comments on the PR that added WebStorm support initially. I guess the discussion should proceed here though since it's a new issue.

As @SimenB comment in the original PR:

I don't think it's possible, but the newer intellij uses the api more directly out of the box, so not as needed as before, maybe?

https://blog.jetbrains.com/webstorm/2017/02/webstorm-2017-1-eap-171-3224/

This raises two questions:

  1. Is it still possible to use eslint_d with the new version of WebStorm somehow?
  2. If it can be fixed, is it really worth it?

@idkjs
Copy link
Author

idkjs commented Apr 22, 2017

When I tried to use it, it was asking for the cli file which doesnt exist in this eslint version so i guess i would have to figure out why it needs that to see if its necessary. That is way out of my skill set at this point in my learning so wont be able to help you there. Generally though, its pretty damned fast now so I cant say it will matter.

@kidroca
Copy link

kidroca commented Aug 1, 2017

Hello,
I tinkered with this a bit today and here are my findings:

1. Is it possible to use eslint_d with the new version of WebStorm somehow?

  • Yes. But it will require modification to Webstorm's plugin code. New plugin for eslint_d and update the plugin provider to provide eslint or eslint_d plugin based on the use case. So probably not gonna happen

  • There is no way to modify eslint_d to work with the current Webstorm eslint plugin,
    because the plugin uses/calls eslint.CLIEngine directly, and not via cli

  • If you have Webstrom, you can view it's eslint plugin here: [webstorm install dir]/plugins/JavaScriptLanguage/languageService/eslint

Closer look at the webstorm eslint plugin:

  • it's written in typescript/js
  • it has only sync actions (This may be for a reason)
  • it doesn't actually use the lib/cli apart from validation reasons
  • it uses lib/cli-engine and lib/options similar to the way they are used in eslint_d/lib/linter

2. If it can be fixed, is it really worth it?

  • No

99% It's not worth it, it seems that Webstorm's plugin does pretty much the same. It runs javascript inside some environment it receives events managed by the languageService and then runs lint/fix/format commands (the commands are executed sync)

PS

While I was tinkering with the code, I created the infamous lib/cli.js using eslint/lib/cli as example;

I can convert this to es5 and send you a pull request if you like

@mantoni
Copy link
Owner

mantoni commented Aug 6, 2017

@kidroca Thanks for the detailed analysis. As you mentioned, it's not really worth fixing, because it's now fast enough in WebStorm by default. Maybe we should mention the differences in the WebStorm versions in the README to avoid frustration for others who come across this module.

However, if you're keen to send a PR with a fix, that is absolutely welcome, too. I'm just not able to maintain WebStorm support myself. I rely on the help of the community here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants