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

Comparison to AirBnb Style Guide #94

Closed
justin808 opened this issue Mar 28, 2015 · 2 comments

Comments

@justin808
Copy link

commented Mar 28, 2015

@feross Any comparison to the AirBnb style guide?

It would be awesome to see your version of a fork of that which meets your idea of a JavaScript coding standard. I'm setting up a project for a new startup, so I'm hoping to get this as right as possible from the get-go.

AirBnb has this comment about semicolons: https://github.com/airbnb/javascript#semicolons

// bad
(function() {
  var name = 'Skywalker'
  return name
})()

// good
(function() {
  var name = 'Skywalker';
  return name;
})();

// good (guards against the function becoming an argument when two files with IIFEs are concatenated)
;(function() {
  var name = 'Skywalker';
  return name;
})();
@rlidwka

This comment has been minimized.

Copy link

commented Mar 28, 2015

I assume the "good one" would be this:

;(function() {
  var name = 'Skywalker'
  return name
})()
@feross

This comment has been minimized.

Copy link
Member

commented Mar 29, 2015

The main difference is that standard is a tool, not just a style guide. standard can automatically check, and even format, your code.

Maybe eventually someone will write up a more verbose style guide for standard, but for now the best way to learn about it is to install it and run it against your code :)

@feross feross closed this Mar 29, 2015

feross added a commit that referenced this issue Apr 22, 2016

@lock lock bot locked as resolved and limited conversation to collaborators May 11, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.