jshint/jshint — Issue #396: jsc.js should have an option to print globals, implied globals and unused vars
Author: danvk
Created: 2011-12-26 05:13:10+00:00
State: open

It current only prints the contents of the JSHINT.errors array, which does not contain these three types of issues. The following addition to jsc.js would make it print the additional problems:

```javascript
var data = JSHINT.data();
if (data.unused !== undefined) {
for (var i = 0, unused; unused = data.unused[i]; i++) {
print('Unused variable "' + unused.name + '" (line: ' + unused.line + ')');
}
}

if (data.globals !== undefined) {
for (var i = 0, globals; global = data.globals[i]; i++) {
print('Global variable "' + global + '"');
}
}

if (data.implieds !== undefined) {
for (var i = 0, implied; implied = data.implieds[i]; i++) {
print('Implied global variable "' + implied.name + '" (line: ' + implied.line + ')');
}
}
```

Presumably these should be options, rather than always on.