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

Suggestion: Implement JS Standard Style #53

Closed
ashack293 opened this issue Aug 13, 2015 · 8 comments
Closed

Suggestion: Implement JS Standard Style #53

ashack293 opened this issue Aug 13, 2015 · 8 comments

Comments

@ashack293
Copy link

I wanted to suggest adoption of JavaScript Standard Style. This is purely in the interest of enforcing some consistency in the code from many contributors. Since it's pretty early in the codebase's life, it wouldn't be too hard to do, and it may help a lot down the road.

@robstolarz
Copy link

I was about to agree with this, but then I saw some questionable choices such as "No semicolons" and "Space after function name".

For something that calls itself "standard", you'd be hard-pressed to find JS code that uses zero semicolons. Also, people like to put spaces between ifs and their conditions while removing it from functions, to allow distinguishing between the two visually like

if (this) {
  thenThat(a,b);
} else {
  otherThing();
}

I do agree with some kind of code style/linting, and I think the "npm test runs a linter" idea is phenomenal. Just, maybe not this style. It's really kind of a misnomer, in my opinion.

@ashack293
Copy link
Author

I agree that some of the formatting choices are not my favorites. I do love my semi-colons.

But I use Sublime Text, so I installed a package that auto-formats my .js files when I save them: https://packagecontrol.io/packages/StandardFormat . This makes it a lot easier.

@austencollins
Copy link
Member

Update 8/13/15:

We’re currently working on a document that outlines the specifications for JAWS v1.0.0.

A proposed resolution to this issue in particular is included in that document.

Today or tomorrow, we will share the document for everyone to comment on because your feedback is essential.

@austencollins austencollins added this to the v1.0 milestone Aug 19, 2015
@ashack293
Copy link
Author

We're using airbnb's style guide, so this issue can be closed.

@doapp-ryanp
Copy link
Contributor

@ashack293 check #64 for our proposed implementation / enforcement of airbnb (with 2 tweaks). Make sure to checkout the README.md cuz our choice of JSCS makes it easy to use with most editors. FWIW I use WebStorm 11 and its working very nicely.

@ashack293
Copy link
Author

@doapp-ryanp yeah, I made a comment in the spec referring other Sublime Text users to the SublimeLinter package for enforcement of airbnb. I didn't really care which standard we used, so long as we use one ;)

@doapp-ryanp
Copy link
Contributor

Yup - JSCS overview has one too for sublime. If you use its Airbnb preset and suck in our .jscsrc included in the project it will make your life easier IMO. Totally up to you.

@ashack293
Copy link
Author

Cool, thanks!

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