elicwhite / ESLint-Formatter

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

Invalid or unexpected token #60

Closed omnichronous closed 6 years ago

omnichronous commented 6 years ago

eslint-error

I get this error when trying to format a file. The only non-standard thing about my configuration is that I use the Node version manager.

My ESLint config points to the usual node.exe location:

"eslint_path": {
  "windows": "C:/Program Files/nodejs/node.exe"
}

And I tried multiple Node versions - 8.9.3, 8.9.4, 9.5.0 - it didn't make a difference.

omnichronous commented 6 years ago

I found the problem - I messed up my configuration. Using the correct paths got rid of the problem:

// The location of the globally installed eslint package to use as a fallback
"node_path": {
    "windows": "C:/Program Files/nodejs/node.exe",
    "linux": "/usr/bin/eslint",
    "osx": "/usr/local/bin/eslint"
},

// The location of the globally installed eslint package to use as a fallback
"eslint_path": {
    "windows": "C:/Program Files/nodejs/node_modules/eslint/bin/eslint",
    "linux": "/usr/bin/eslint",
    "osx": "/usr/local/bin/eslint"
}