How to run eslint in * .js.erb files?

I would like to use the files in the rails project (ideally, in the editor when making changes) through eslint , but at the moment I can not use files pre-processed with ERB.

How can I include * .js.erb files in the listing process?

+5
source share
1 answer

You will need to run eslint with the -ext js.erb flag. However, if your files contain more than just javascript, you will have to create your own plugin with a processor that will supersede everything except pure javascript and maintain the original map so that error messages can be changed to indicate the correct line numbers after lining, Here you can see additional information about processors: http://eslint.org/docs/developer-guide/working-with-plugins#processors-in-plugins

0
source

All Articles