cloudhead/less.js — pull request #1317 by mcandre (2013-05-09 02:54:16+00:00)
Title: Linting with JSHint

[JSHint](http://jshint.com/) is a snappy tool for scanning code for potential bugs. I took a look at less.js with `jshint .` and found a number of warnings we might want to look at.

$ jshint .
benchmark/less-benchmark.js: line 8, col 72, Missing semicolon.
benchmark/less-benchmark.js: line 14, col 41, Missing radix parameter.
benchmark/less-benchmark.js: line 16, col 21, Missing '()' invoking a constructor.
benchmark/less-benchmark.js: line 19, col 23, Missing '()' invoking a constructor.
benchmark/less-benchmark.js: line 26, col 36, Missing radix parameter.
benchmark/less-benchmark.js: line 28, col 25, Missing '()' invoking a constructor.
benchmark/less-benchmark.js: line 30, col 23, Missing '()' invoking a constructor.
benchmark/less-benchmark.js: line 34, col 36, Missing radix parameter.
benchmark/less-benchmark.js: line 39, col 60, Missing radix parameter.

build/require-rhino.js: line 6, col 2, Unnecessary semicolon.

build/require.js: line 6, col 2, Unnecessary semicolon.

dist/less-1.1.0.js: line 14, col 2, Unnecessary semicolon.
dist/less-1.1.0.js: line 81, col 21, 'rv' used out of scope.
dist/less-1.1.0.js: line 90, col 17, 'rv' used out of scope.
dist/less-1.1.0.js: line 90, col 37, 'rv' used out of scope.
dist/less-1.1.0.js: line 93, col 16, 'rv' used out of scope.

...

test/browser/jasmine-html.js: line 75, col 22, Use '===' to compare with '0'.
test/browser/jasmine-html.js: line 208, col 2, Missing semicolon.
test/browser/jasmine-html.js: line 380, col 17, Missing semicolon.

test/browser/jasmine.js: line 1418, col 213, Missing semicolon.
test/browser/jasmine.js: line 1481, col 7, Confusing use of '!'.
test/browser/jasmine.js: line 1559, col 16, Use '!==' to compare with 'null'.
test/browser/jasmine.js: line 1792, col 6, Don't make functions within a loop.
test/browser/jasmine.js: line 2095, col 8, Don't make functions within a loop.

test/browser/phantom-runner.js: line 52, col 60, eval can be harmful.
test/browser/phantom-runner.js: line 60, col 52, eval can be harmful.
test/browser/phantom-runner.js: line 65, col 2, Unnecessary semicolon.
test/browser/phantom-runner.js: line 122, col 2, Unnecessary semicolon.

test/browser/runner-main.js: line 9, col 75, Missing semicolon.

test/browser-test-prepare.js: line 10, col 2, Missing semicolon.
test/browser-test-prepare.js: line 36, col 2, Missing semicolon.

test/less-test.js: line 21, col 71, Missing semicolon.
test/less-test.js: line 86, col 44, Missing semicolon.
test/less-test.js: line 102, col 50, Missing semicolon.
test/less-test.js: line 167, col 36, Missing semicolon.

1299 errors

I was able to filter out some of these by with `.jshintrc`, but the rest I think deserve a look. I'm not familiar enough with less.js's coding preferences to resolve these, so I left them alone for now.