Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

rake eslint:run_all or rake eslint:run[filename] not working #35

Open
ganeshkumar opened this issue Aug 1, 2017 · 1 comment
Open

Comments

@ganeshkumar
Copy link

ganeshkumar commented Aug 1, 2017

Please note that i am using node version 0.12.4

filename: is the exact file path of js file.

when i run rake eslint:run_all/ rake eslint:run[filename] below error is throwing up

ExecJS::ProgramError: TypeError: Cannot read property 'firebug' of undefined Function.useColors (eval at <anonymous> ((execjs):1:266), <anonymous>:13435:75) createDebug (eval at <anonymous> ((execjs):1:266), <anonymous>:13688:29) Object.debug (eval at <anonymous> ((execjs):1:266), <anonymous>:49889:29) s (eval at <anonymous> ((execjs):1:266), <anonymous>:12502:620) eval (eval at <anonymous> ((execjs):1:266), <anonymous>:12502:671) Object../debug-helpers (eval at <anonymous> ((execjs):1:266), <anonymous>:47845:13) s (eval at <anonymous> ((execjs):1:266), <anonymous>:12502:620) eval (eval at <anonymous> ((execjs):1:266), <anonymous>:12502:671) Object../code-path-segment (eval at <anonymous> ((execjs):1:266), <anonymous>:48117:23) s (eval at <anonymous> ((execjs):1:266), <anonymous>:12502:620) Tasks: TOP => eslint:run_all

Please let me know anything is wrong? trying with latest version 1.3.0 and 1.2.2 getting same error.

but 1.2.1 works only for js files not es6 files.

@ganeshkumar ganeshkumar changed the title rake eslint:run_all not working rake eslint:run_all or rake eslint:run[filename] not working Aug 1, 2017
@joaumg
Copy link

joaumg commented Nov 13, 2017

OK, found where and how to fix this one...

First thought of mine was to pass another runtime to ExecJS...

EXECJS_RUNTIME='Node' rake eslint:run_all

Which didn't work since the runtime is hard coded...

ENV['EXECJS_RUNTIME'] = 'RubyRacer'

So, the solution is to add gem "therubyracer" to your Gemfile, run bundle install, and you're done.

What is weird is that therubyracer is a dev dependency and not a common dependency...

https://github.com/appfolio/eslint-rails/blob/master/eslint-rails.gemspec#L29

Maybe a pull request to fix that would be accepted?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants