11

I am trying to get babel-eslint to work on Sublime 3. I have installed:

  • eslint and babel-eslint globally on npm
  • SublimeLinter package on Sublime
  • SublimeLinter-contrib-eslint package on Sublime

Also, I have added: "syntax_map": { ... "JavaScript (Babel)": "javascript" } to my SublimeLinter.sublime-settings file.

When I run the linter with "parser": "espree" on my .eslintrc file it works fine. But when I change the parser to babel-eslint it stops working.

I tried to follow the tutorial here: https://medium.com/@dan_abramov/lint-like-it-s-2015-6987d44c5b48 and I seem to be doing everything correctly.

Any ideas on what I'm doing wrong?

Leonid Beschastny
  • 50,364
  • 10
  • 118
  • 122
Ren
  • 431
  • 6
  • 15

1 Answers1

9

Except what was in mentioned tutorial, what helped me was:

  • upgrade global / local eslint to latest version
  • install babel-eslint locally
  • if you are using any eslint plugins, it appears they must be also installed locally (eslint-plugin-react in my case)
  • as Dalgard mentioned you can also enable debug mode in Sublime eslint to find out what else can be wrong, i.e. incompatible versions or corrupted config.

I hope some of this will help.

zangrafx
  • 129
  • 3
  • I did all three steps and it's working perfectly now. Thanks! – Ren May 02 '15 at 17:52
  • I was having problems with this too. I would never imagine that it was necessary to install eslint-plugin-react locally =/ Tks a lot! – rafaelbiten Jun 11 '15 at 02:24
  • This is not enough to make it work for me – can you confirm that your setup also work with the newest versions? eslint@2.3.0, babel-eslint@5.0.0 – dalgard Mar 11 '16 at 13:54
  • I just figured out enabling debug mode (!) and see a message that the versions are not compatible. I'll simply make sure compatible versions are installed. – dalgard Mar 11 '16 at 14:00
  • 1
    Run `eslint --init` in proj dir – GN. Aug 03 '16 at 10:04