Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

hint: avoid passing custom option to jshint config

  • Loading branch information...
commit f18155a766d6a4a3f396bafb713f0aae653faa92 1 parent 0cda1bb
@rauchg rauchg authored brentlintner committed
Showing with 8 additions and 1 deletion.
  1. +8 −1 lib/hint.js
View
9 lib/hint.js
@@ -9,6 +9,7 @@ var fs = require('fs'),
function _lint(file, results, config, data) {
var buffer,
+ globals,
lintdata;
try {
@@ -21,7 +22,13 @@ function _lint(file, results, config, data) {
// Remove potential Unicode Byte Order Mark.
buffer = buffer.replace(/^\uFEFF/, '');
- if (!jshint.JSHINT(buffer, config, config['globals'])) {
+ // remove custom node-jshint option
+ if (config.globals) {
+ globals = config.globals;
+ delete config.globals;
+ }
+
+ if (!jshint.JSHINT(buffer, config, globals)) {
jshint.JSHINT.errors.forEach(function (error) {
if (error) {
results.push({file: file, error: error});
Please sign in to comment.
Something went wrong with that request. Please try again.