Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.jshintrc global aren't being picked up #12

Open
andywillis opened this issue Nov 19, 2014 · 0 comments
Open

.jshintrc global aren't being picked up #12

andywillis opened this issue Nov 19, 2014 · 0 comments

Comments

@andywillis
Copy link

Apologies, I tried to submit a PR but the tests failed or failed to run at all (I'm developing on a Windows machine - le sigh).

Summary
I noticed that when I was using this module the global options I had set up in my .jshintrc file were not being picked up by jshint. According to this comment the globals need to be passed in as the third parameter when calling jshint.

My PR would have looked like this:

JSHinter.prototype.processString = function (content, relativePath) {

  var globals;
  if (this.jshintrc && this.jshintrc.globals) {
    globals = this.jshintrc.globals;
    delete this.jshintrc.globals;
  } else {
    globals = {};
  }

  var passed = JSHINT(content, this.jshintrc, globals);
  var errors = this.processErrors(relativePath, JSHINT.errors);

  if (!passed && this.log) {
    this.logError(errors);
  }

  if (!this.disableTestGenerator) {
    return this.testGenerator(relativePath, passed, errors);
  }
};

Any chance someone could make the pull request for me?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant