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

Move generated parenthesis for IIFE into the parens #225

Closed
MathRobin opened this issue Dec 29, 2014 · 3 comments
Closed

Move generated parenthesis for IIFE into the parens #225

MathRobin opened this issue Dec 29, 2014 · 3 comments

Comments

@MathRobin
Copy link

Hi,

I would like to suggest a really small but important for JSLint users. I refer to this error in JSLint : https://jslinterrors.com/move-the-invocation-into-the-parens-that-contain-the-function

You have this :

var SkinnedMesh = (function (THREE) {
  var SkinnedMesh = function SkinnedMesh() {
    //...
  };
  SkinnedMesh.prototype.update = function () {
    //...
  };
  return SkinnedMesh;
})(THREE);

But to be JSLint valid, it should be :

var SkinnedMesh = (function (THREE) {
  var SkinnedMesh = function SkinnedMesh() {
    //...
  };
  SkinnedMesh.prototype.update = function () {
    //...
  };
  return SkinnedMesh;
}(THREE));

As you can see, it's a small improvement but it's important OMHO.

@hshoff
Copy link
Member

hshoff commented Jan 1, 2015

Hi @MathRobin thanks for checking out the style guide!

This is a style choice that we made at Airbnb. Feel free to use the JSLint/Crockford style IIFE, the important part is consistency in the codebase.

For more info: #85, #21

🍻

@hshoff hshoff closed this as completed Jan 1, 2015
@mashenoy
Copy link

@hshoff : Is -there any options config setting we could use to disable this warning ?

@ljharb
Copy link
Collaborator

ljharb commented Feb 10, 2017

@shenoydev you can certainly override the eslint rule, just like any other rule can be overridden.

That said, IIFEs shouldn't be needed in a world with modules, so this ideally shouldn't even come up :-)

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

4 participants