Git Product home page Git Product logo

Comments (5)

bobholt avatar bobholt commented on August 23, 2024

Are you referring to this case?

define( [ 
  'module1',
  'module2'
], function(module1) {

  // I don't have a module2 argument

});

or this case?

define([
  'module1',
  'module2'
], function(module1, module2) {

  module1();

  // I don't use module2

});

from bullsfirst-jquery-backbone.

bobholt avatar bobholt commented on August 23, 2024

Oh, I see it doing the second one, and neither grunt nor sublime's jshint is catching it. That seems new. I think I was getting the unused errors very recently.

from bullsfirst-jquery-backbone.

bobholt avatar bobholt commented on August 23, 2024

Ah, and here's what I just observed: if the unused argument is at the END of the arguments list, JSHint catches it, but not if it's anywhere else in the arguments list.

And here, I found it's intentional JSHint behavior: jshint/jshint@5751c5e

from bullsfirst-jquery-backbone.

nareshbhatia avatar nareshbhatia commented on August 23, 2024

Thanks for tracking this down. So the commit happened 5 months ago - does this mean that it has not made it to grunt?

from bullsfirst-jquery-backbone.

bobholt avatar bobholt commented on August 23, 2024

No, this is the intended behavior. Unuseds that are followed by useds will not throw an error.

That commit message explains why. I think it should be an optional flag, but that's what we have.

from bullsfirst-jquery-backbone.

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.