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

Problem with global installed eslint #22

Closed
ruanyl opened this issue Nov 22, 2015 · 6 comments
Closed

Problem with global installed eslint #22

ruanyl opened this issue Nov 22, 2015 · 6 comments

Comments

@ruanyl
Copy link
Contributor

ruanyl commented Nov 22, 2015

Hi, I still the problem of eslint which is installed globally. Currently, if eslint_d cannot found eslint under working dir, it will load the eslint which installed under eslint_d.

Everything works just fine until I need to load eslint-plugin-*. these plugins are installed globally also. And they are loaded by eslint.

eslint seems not looking for global plugins if it's installed and loaded as a local module. An issue may relevant to this: eslint/eslint#4472

I am just thinking that would it makes more sense for eslint_d to load global eslint instead of local eslint under eslint_d?

I made a small change to the way of loading eslint, and I tested it with eslint_d cli and vim. It works just fine.

I will make a pull request for this :)

@mantoni
Copy link
Owner

mantoni commented Feb 20, 2016

The issue you referred to is now resolved and there is the cwd option support is eslint now. It's intentional to load the local eslint install and fall back to a global one. This makes it possible to have different eslint versions in two projects.

I'm wondering whether the issue can be solved by feeding the cwd option to eslint. Would you be able to investigate?

@mantoni
Copy link
Owner

mantoni commented Feb 25, 2016

eslint_d 3.0.0 now passes on the cwd option to eslint. Can you please check if it's working for you now?

@ruanyl
Copy link
Contributor Author

ruanyl commented Feb 25, 2016

@mantoni thanks for the update! Looks like it works for me 👍

How eslint_d resolve eslint now?

@mantoni
Copy link
Owner

mantoni commented Feb 25, 2016

The resolve mechanics didn't change.

@mantoni mantoni closed this as completed Feb 25, 2016
@jstejada
Copy link

Hi @mantoni , the cwd option is not working for me. When I try to run it I get:

Error: Invalid option '--cwd' - perhaps you meant '-c'?

Am I missing something?
Thanks!

@mantoni
Copy link
Owner

mantoni commented Mar 21, 2016

The cwd option is set to your current directory and passed to the eslint API. It's not a command line option.

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

No branches or pull requests

3 participants