Merge pull request #12258 from atom/mq-js-styleguide

Add JS style guide to the Contributing guide
This commit is contained in:
Nathan Sobo 2016-07-29 09:15:36 -06:00 committed by GitHub
commit aedc0d1c16

View File

@ -20,6 +20,7 @@ These are just guidelines, not rules, use your best judgment and feel free to pr
[Styleguides](#styleguides)
* [Git Commit Messages](#git-commit-messages)
* [JavaScript Styleguide](#javascript-styleguide)
* [CoffeeScript Styleguide](#coffeescript-styleguide)
* [Specs Styleguide](#specs-styleguide)
* [Documentation Styleguide](#documentation-styleguide)
@ -280,6 +281,25 @@ If you want to read about using Atom or developing packages in Atom, the [Atom F
* :arrow_down: `:arrow_down:` when downgrading dependencies
* :shirt: `:shirt:` when removing linter warnings
### JavaScript Styleguide
All JavaScript must adhere to [JavaScript Standard Style](http://standardjs.com/).
* Prefer `Object.assign()` to the object spread operator (`{...anotherObj}`)
* Inline `export`s with expressions
```js
// Use this:
export default class ClassName {
}
// Instead of:
class ClassName {
}
export default ClassName
```
### CoffeeScript Styleguide
* Set parameter defaults without spaces around the equal sign