Skip to content

Commit

Permalink
refactor: pass options.global as predef arg to JSHINT (#216)
Browse files Browse the repository at this point in the history
The JSHINT [API](http://jshint.com/docs/api/) specifies that `globals` actually get passed as the `predef`, the 3rd argument to the function and not part of the `options`. This fixes that.

Compare with CodeMirror's jshint integration: https://github.com/codemirror/CodeMirror/blob/e49a19f5cacb447558f162014eb26b8c45b30941/addon/lint/javascript-lint.js#L31
  • Loading branch information
westonruter authored and thedaviddias committed Sep 3, 2018
1 parent 7d698f5 commit 48cf82d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/jshint.js
Expand Up @@ -28,7 +28,7 @@ HTMLHint.addRule({
styleCol = event.col - 1;
var code = event.raw.replace(/\t/g,' ');
try{
var status = jsVerify(code, options);
var status = jsVerify(code, options, options.globals);
if(status === false){
jsVerify.errors.forEach(function(error){
var line = error.line;
Expand Down

0 comments on commit 48cf82d

Please sign in to comment.