Eslinter and .js.erb files


#1

Hi! I’m using this .eslintrc. configuration file in my project:

{
  "extends": "airbnb",
  "rules": {
    "func-names": ["error", "never"],
    "no-var": 0,
    "vars-on-top": 0
  },
  "plugins": ["html"],
  "settings": {
    "html/html-extensions": [".js.erb"],
  },
  "overrides": [
    {
      "files": ["app/**/*.js.erb", "app/**/*.js"]
    }
  ]
}

but I can’t get eslint to work with .js.erb files.

It works if I run eslint --ext .js.erb,.js . from the project directory, but I can’t make it work in atom.
(I tried to alias eslint to eslint --ext .js.erb,.js ., but it doesn’t work)

Any suggestions?


#2

What happens if you run eslint --ext .js.erb,.js . through a terminal package or process-palette?


#3

Thanks man! At the end the most simple solution was to create this alias:

alias eslint='eslint --ext .js.erb,.js'