passing options to rake eslint:run
Sorry if I have missed any obvious point, how do I pass option to eslint while running rake eslint:run
I am adding this gem to my rails project and I want to run eslint on only chnaged or new files, so I need to pass option --cache to eslint
So I think we should just add a ~~variable~~ parameter to the rake task. When we do rake test, we can do
rake test TEST=path/to/my_test.rb TESTOPTS='--name=test_a_feature'
So I'm thinking we could add something so you can do
rake eslint:run ESLINTOPTS='--cached'
The only downside I see is that we probably should not mirror this capability in the web interface because I haven't thought of a good way to do it yet. Also, maybe people don't use the web interface?
I certainly love the web interface when I am manually fixing warnings/errors by hand. It helps a lot, and reduces the strain of having to read terminal output, which isn't always pretty.
I do wish there was an easier way to provide flags, and think it is critical considering eslint can attempt to auto correct issues with the --fix flag. Rubocop has an excellent way of handling flags like that, and I would very much like to see this be a thing with eslint-rails.
I will consider taking a look at this perhaps contributing in order to make this a reality 😎🤔🍻
So I forked this repo and wrote in code to allow for auto-correction, as well as a few more goodies. Seeing as this repo isn't really being actively maintained, I will keep the fork separate unless it is desired that they be merged.
New features include
- updated readme
- updated eslint
- autocorrection feature
- different exit statuses based on eslint.json settings. If you have a rule set to error, the build will exit 1. If it is set to warning and no errors exist, it will exit 0
- updated the controller to not break if you don't provide
force_deafult - updated the web interface to allow you to use autocorrect, or not
- updated the rake tasks
- updated the before_filter to be before_action, since the former was deprecated
I'll be continuing my own support for this in my free time, and intend to include many more features and improvements :)