adobe/brackets — pull request #4557 by TomMalbran (2013-07-24 08:10:54+00:00)
Title: Updated JSLint to the latest version and fixed all the new errors

This might be a big request, but all the changes done are very simple.

1. Updated the JSlint directives to: `/*jslint vars: true, plusplus: true, devel: true, nomen: true, todo: true, unparam: true, indent: 4, maxerr: 50 */` on every file and added `regexp: true, forin: true, browser: true, node: true` after the maxerror directive when required in the file. The new things here are `todo: true` to allow TODO comments and `unparam: true` to fix issues were one of the first parameter isn't used, but one of the last one is, for example, with event listeners. If JSLint would get updated to support this things, we could probably remove this directive.

2. The rest of the fixes are:
a. Removed unused variables and some functions.
b. Fixed the use of else after a return or break.
c. Empty functions aren't allowed, but adding `return undefined;` keeps the same idea of an empty function.
d. Removed assignments inside the while guard.
e. Moved variables declared inside a loop outside of it.
f. Removed parenthesis around variables.
g. Removed some unused parameters.
h. Removed empty callbacks when using `brackets.fs.unlink` since is no optional.
i. Plus other minor changes.

I tested and everything seems to work fine. All tests are passing, with the exception of the first JSLint test which I couldn't fix.

There are still errors in the files: `src/LiveDevelopment/Agents/RemoteFunctions.js`, `test/SpecRunner.js` and `test/spec/LiveDevelopment-test.js`. Where an instance of a class is created and assigned to a variable, but then never used. Removing the variable would mean that the instance is created but not stored, which also gives an error. So wasn't sure how to fix those errors.

The new warnings for unused variables and using spaces instead of tabs are great.