Emacs flymake-jslint show all errors

602 views Asked by At

I want to use jslint in emacs, so I installed package flymake-jslint and flymake-cursor. I have really simple javascript file:

/*global desc, task, jake, fail, complete */
"use strict";
task("example", function() {
    var x = 5
    console.log("asdf");
});

Flymake properly highlights var x = 5 and I get Unused 'x'. in mini buffer. However, when I run jslint from command line, I get:

$ jslint jakefile.js

jakefile.js
 #1 Expected exactly one space between 'function' and '('.
    task("example", function() { // Line 3, Pos 25
 #2 Expected ';' and instead saw 'console'.
    var x = 5 // Line 4, Pos 14
 #3 Unused 'x'.
    var x = 5 // Line 4, Pos 9

Is there a way to configure flymake-jslint to show me those non syntax error, like "Expected space"?

1

There are 1 answers

0
tkowal On

I've found the answer :)

There is config variable called flymake-jslint-args. When i run describe-variable it showed me something like this:

flymake-jslint-args is a variable defined in `flymake-jslint.el'. Its value is ("--white" "--undef" "--nomen" "--regexp" "--plusplus" "--bitwise" "--newcap" "--sloppy" "--vars" "--eqeq")

Documentation: Command-line args for jslint executable.

All those command line arguments are types of errors, that will be ignored while running jslint, so I've set this variable to ().

(setq flymake-jslint-args ())

and now I get all the errors, like I wanted.