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 f311bb5 commit 0172d62
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rules/jshint.js
Original file line number Diff line number Diff line change
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 0172d62

Please sign in to comment.