Skip to content

Instantly share code, notes, and snippets.

@mantoni
Created March 21, 2015 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mantoni/f60ce597062e9fa31ff5 to your computer and use it in GitHub Desktop.
Save mantoni/f60ce597062e9fa31ff5 to your computer and use it in GitHub Desktop.
JSLint unused variable
/*jslint node: true */
'use strict';
var x = require('x');
function foo() {
var y = 'bar';
}
// JSLint reports "Unused 'y'.", but not Unused 'x'.
@vschoettke
Copy link

JSLint should also report unused foo in that case.

@mantoni
Copy link
Author

mantoni commented Mar 21, 2015

Yes, well spotted. And now the preview at http://new.jslint.com/jslint.html does report x, y and foo as being unused correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment