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

flymake mode in javascript #21

Open
mattharrison opened this issue Jan 15, 2010 · 3 comments
Open

flymake mode in javascript #21

mattharrison opened this issue Jan 15, 2010 · 3 comments
Labels

Comments

@mattharrison
Copy link

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

@purcell
Copy link

purcell commented Nov 13, 2011

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

@mattharrison
Copy link
Author

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

@purcell
Copy link

purcell commented Nov 14, 2011

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. :-)

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

No branches or pull requests

2 participants