elicwhite / ESLint-Formatter

Sublime Text 3 Plugin to Autoformat with Eslint
MIT License
139 stars 20 forks source link

can not find module '/usr/local/bin/eslint' - eslint_d #56

Closed craigcosmo closed 7 years ago

craigcosmo commented 7 years ago

Hi,

I installed eslint_d package in sublime. And then npm i -g eslint_d in terminal

And the set up this config in sublime

screen shot 2017-11-09 at 5 53 45 pm

then try to format lint and I got this error

screen shot 2017-11-09 at 5 54 09 pm
cristianl commented 7 years ago

To use a globally installed eslint_d, your user settings should be:

{
  "local_eslint_path": {
    "osx": "node_modules/.bin/eslint_d"
  },
  "eslint_path": {
    "osx": "/usr/local/bin/eslint_d"
  },
  "format_on_save": false
}

By default, ESLint Formatter looks for the regular eslint, not eslint_d (in /usr/local/bin/eslint – line 25 in the left side panel). "local_eslint_path" applies only if you install eslint_d locally to your project (npm install eslint_d)

elicwhite commented 7 years ago

Thanks for that answer @cristianl.

I believe this is also mentioned in the README: https://github.com/TheSavior/ESLint-Formatter#performance

If the readme isn't clear about how to set this up, I'd be happy to accept a PR adding more information.