emacs-starter-kit icon indicating copy to clipboard operation
emacs-starter-kit copied to clipboard

flymake mode in javascript

Open mattharrison opened this issue 14 years ago • 3 comments

Flymake for js doesn't work out of the box. There's some hardcoded Windows paths in there.

I have a script that runs jslint, so I hooked that up. The regexes need to be updated for jslint as well....

diff --git a/elpa-to-submit/nxhtml/related/flymake-js.el b/elpa-to-submit/nxhtml/related/flymake-js.el index 56aa571..73f5feb 100644 --- a/elpa-to-submit/nxhtml/related/flymake-js.el +++ b/elpa-to-submit/nxhtml/related/flymake-js.el @@ -87,6 +87,8 @@ ;; These pattern are probably for Rhino: ("^js: "(.+)", line ([0-9]+): (.+)$" 1 2 nil 3) ("^js: uncaught JavaScript (.+)$" nil nil nil 1) + ;; jslint + ("^Lint at line ([[:digit:]]+) character ([[:digit:]]+): (.+)$" nil 1 2 3) ;; These pattern are probably for SpiderMonkey: ("^(.+):([0-9]+): (SyntaxError:.+):$" 1 2 nil 3) ("^(.+):([0-9]+): (strict warning: trailing comma.+):$" 1 2 nil 3) @@ -130,11 +132,14 @@ not figure out what buffers and processes to kill." (lwarn 't :warning "Can't find rhino.js: %s" flymake-js-rhino-js)) (cond ((eq flymake-js-engine 'rhino) - (list "java" (list "-jar" flymake-js-rhino-jar flymake-js-rhino-js local-file))) - ((eq flymake-js-engine 'spidermonkey) + ;; (list "java" (list "-jar" flymake-js-rhino-jar flymake-js-rhino-js local-file))) + (list "flymakejs.sh" (list local-file))) + ((eq flymake-js-engine 'spidermonkey) (list "js" (list "-s" local-file))) (t - (error "Bad value: %s" flymake-js-engine))))) + (error "Bad value: %s" flymake-js-engine))) + )) +

 (defun flymake-js-load ()
   (dolist (rec flymake-allowed-js-file-name-masks)

What would be the process for resolving this? I'm assuming we just need to package/include os neutral jslint.

Let me know what I can do to help.

cheers

mattharrison avatar Jan 15 '10 00:01 mattharrison

Not sure if it helps, but there's this package of mine: http://marmalade-repo.org/packages/flymake-jslint

purcell avatar Nov 13 '11 08:11 purcell

I'm on el-get now, but I'll check out your package. Thanks.

mattharrison avatar Nov 14 '11 05:11 mattharrison

I used to use el-get too... now enjoying having everything in elpa, even though it meant I had to package up a bunch of stuff. :-)

purcell avatar Nov 14 '11 08:11 purcell