Giter VIP home page Giter VIP logo

Comments (7)

smikes avatar smikes commented on August 18, 2024

Thanks for finding this. As you note, it is exactly a problem where the argument to loadJSLintFromPath() is shadowing the higher-level variable path, and then the call to path.resolve fails.

Fixed with latest grunt-jslint 1.1.11, please update to get the new version.

from grunt-jslint.

novaez avatar novaez commented on August 18, 2024

Could I have one more question? Why did the unit test pass with the two conflict variables?

from grunt-jslint.

smikes avatar smikes commented on August 18, 2024

function loadJSLintFromPath was not covered by the unit tests. And apparently jslint doesn't regard it as an error when one variable shadows another.

from grunt-jslint.

novaez avatar novaez commented on August 18, 2024

There was a case for loadJSLintFromPath loading a specific path in test/editions.js:

  jslint.loadJSLintFromPath('node_modules/jslint/lib/jslint-2013-08-26.js', function () {
    validate(file, opts, this.callback);
  }.bind(this));

},
'should not error': function (err, report) {
  assert.ifError(err);
},
'should be a correct edition': function (err, report) {
  assert.ok(jslint.edition === '2013-08-26');
},
'should have no violations': function (err, report) {
  assert.lengthOf(report, 0);
}

from grunt-jslint.

smikes avatar smikes commented on August 18, 2024

Yes. But the assertion in that case was testing for edition '2013-08-26' , which was also the edition loaded by the previous test case. So even if the call to loadJSLintFromPath failed, the test case wouldn't see it.

from grunt-jslint.

stephenmathieson avatar stephenmathieson commented on August 18, 2024

@novaez the custom edition stuff came in as a pr with horrible test coverage. we foolishly assumed it worked and published it without adding proper tests.

sorry for the bug, it's really quite embarrassing.

it should be fixed now, however. can you validate and close the issue?

from grunt-jslint.

novaez avatar novaez commented on August 18, 2024

@smikes Got it. Thanks!
@stephenmathieson I've got the latest version and it worked well. Thanks for all of your efforts.

from grunt-jslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.