jshint/jshint — Issue #395: Specifying a non-existent option should be an error
Author: danvk
Created: 2011-12-26 05:06:30+00:00
State: open

I modified jsc.js to print errors for implied_globals by adding the following:

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

I then wrote this test.js file:
```javascript
function foo() {
console.log('blah');
}```

Then I have:

(Correct)
$ env/jsc.sh test.js
[jshint] Error(s) in test.js:
Implied global variable "console" (line: 2)

(Correct)
$ env/jsc.sh test.js 'devel:true'
[jshint] test.js passed!

(Surprising -- should be an error)
$ env/jsc.sh test.js 'browser:true, devel:true'
[jshint] Error(s) in test.js:
Implied global variable "console" (line: 2)

After much digging, I discovered that the space before "devel" was being passed through as part of the option name. This should be fixed in its own right. But passing in a non-existent option should also be an error.