👍🎉 First off, thanks for taking the time to contribute! 🎉👍
The following is a set of guidelines for contributing to this packages. These are mostly guidelines, not rules. Use your best judgment, and feel free to propose changes to this document in a pull request.
This was modified from Atom's Contributing guidelines with some edits for my own preferences and trimming out things that will never apply to my smaller projects.
Be awesome to each other. See the Code of Conduct.
Bugs, enhancements, and questions and comments are tracked as GitHub issues.
Simply fill in the relevant template.
The process described here has several goals:
- Maintain code quality and style
Please follow these steps to have your contribution considered:
- Follow all instructions in the template
- Follow the styleguides
- Submit a pull request and await triage!
- Commit messages are sentences, using the commit itself as the subject of the first sentence.
- Use the present tense, indicative mood: ("Moves files around", not "Move..." or "Moved...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
- Consider starting the commit message with an applicable emoji:
- 🎨
:art:
when improving the format/structure of the code - 🐎
:racehorse:
when improving performance - 🚱
:non-potable_water:
when plugging memory leaks - 📝
:memo:
when writing docs - 🐛
:bug:
when fixing a bug - 🔥
:fire:
when removing code or files - ✅
:white_check_mark:
when adding tests - 🔒
:lock:
when dealing with security - ⬆️
:arrow_up:
when upgrading dependencies - ⬇️
:arrow_down:
when downgrading dependencies - 👕
:shirt:
when removing linter warnings
- 🎨
All JavaScript must adhere to JavaScript Standard Style.
- Prefer the object spread operator (
{...anotherObj}
) toObject.assign()
- Inline
export
s with expressions whenever possible// Use this: export default class ClassName { } // Instead of: class ClassName { } export default ClassName
- Place requires in the following order:
- Built in Node Modules (such as
path
) - Built in Atom and Electron Modules (such as
atom
,remote
) - Local Modules (using relative paths)
- Built in Node Modules (such as
- Place class properties in the following order:
- Class methods and properties (methods starting with
static
) - Instance methods and properties
- Class methods and properties (methods starting with
- Set parameter defaults without spaces around the equal sign
clear = (count=1) ->
instead ofclear = (count = 1) ->
- Use spaces around operators
count + 1
instead ofcount+1
- Use spaces after commas (unless separated by newlines)
- Use parentheses if it improves code clarity.
- Prefer alphabetic keywords to symbolic keywords:
a is b
instead ofa == b
- Avoid spaces inside the curly-braces of hash literals:
{a: 1, b: 2}
instead of{ a: 1, b: 2 }
- Include a single line of whitespace between methods.
- Capitalize initialisms and acronyms in names, except for the first word, which
should be lower-case:
getURI
instead ofgetUri
uriToOpen
instead ofURIToOpen
- Use
slice()
to copy an array - Add an explicit
return
when your function ends with afor
/while
loop and you don't want it to return a collected array. - Use
this
instead of a standalone@
return this
instead ofreturn @
- Place requires in the following order:
- Built in Node Modules (such as
path
) - Built in Atom and Electron Modules (such as
atom
,remote
) - Local Modules (using relative paths)
- Built in Node Modules (such as
- Place class properties in the following order:
- Class methods and properties (methods starting with a
@
) - Instance methods and properties
- Class methods and properties (methods starting with a
- Include thoughtfully-worded, well-structured Jasmine specs in the
./spec
folder. - Treat
describe
as a noun or situation. - Treat
it
as a statement about state or how an operation changes state.
describe 'a dog', ->
it 'barks', ->
# spec here
describe 'when the dog is happy', ->
it 'wags its tail', ->
# spec here