tav/nodelint — Issue #30: Nodelint reporters make no difference to output
Author: nelstrom
Created: 2012-01-13 09:27:04+00:00
State: open

Nodelint could be the commandline interface to JSLint that I've been looking for. The reporters feature sets it apart from the other tools I've looked at (e.g. https://github.com/reid/node-jslint), but so far I been unable to make them work. I wonder if you can help?

I'm using this snippet of JS as a test:

var i;
for (i=1; i <= 100; i++) {
if(i % 15 == 0) {
console.log('Fizzbuzz');
} else if(i % 5 == 0) {
console.log('Buzz');
} else if(i % 3 == 0) {
console.log('Fizz');
} else {
console.log(i);
}
};

If I run nodelint without specifying a reporter, I get the following output:

nodelint fizzbuzz.js
The "sys" module is now called "util". It should have a similar interface.
/Users/drew/code/nodelint/fizzbuzz.js, line 2, character 22: Unexpected '++'.
for (i=1; i <= 100; i++) {
/Users/drew/code/nodelint/fizzbuzz.js, line 3, character 15: Expected '===' and instead saw '=='.
if(i % 15 == 0) {
/Users/drew/code/nodelint/fizzbuzz.js, line 5, character 21: Expected '===' and instead saw '=='.
} else if(i % 5 == 0) {
/Users/drew/code/nodelint/fizzbuzz.js, line 7, character 21: Expected '===' and instead saw '=='.
} else if(i % 3 == 0) {
/Users/drew/code/nodelint/fizzbuzz.js, line 12, character 2: Unexpected ';'.
};
5 errors

I get exactly the same output if I include `--reporter lib/reporters/vim.js`, and the same goes for all of the reporters that are bundled in the `nodelint/lib/reporters` directory. Here's an example of the output. I've included the command line that I entered, so you can see if I'm doing anything wrong:

nodelint fizzbuzz.js --reporter lib/reporters/vim.js
The "sys" module is now called "util". It should have a similar interface.
/Users/drew/code/nodelint/fizzbuzz.js, line 2, character 22: Unexpected '++'.
for (i=1; i <= 100; i++) {
/Users/drew/code/nodelint/fizzbuzz.js, line 3, character 15: Expected '===' and instead saw '=='.
if(i % 15 == 0) {
/Users/drew/code/nodelint/fizzbuzz.js, line 5, character 21: Expected '===' and instead saw '=='.
} else if(i % 5 == 0) {
/Users/drew/code/nodelint/fizzbuzz.js, line 7, character 21: Expected '===' and instead saw '=='.
} else if(i % 3 == 0) {
/Users/drew/code/nodelint/fizzbuzz.js, line 12, character 2: Unexpected ';'.
};
5 errors

I have the latest versions of node and nodelint installed, as follows:

node: 0.6.7
nodelint: 0.5.2

Do you have any idea what might be causing this?

Thanks,
Drew