-
Notifications
You must be signed in to change notification settings - Fork 0
Coding standards
Matt Acosta edited this page Nov 27, 2017
·
4 revisions
- Should only contain a single statement.
- Should be limited to 80 characters if possible.
- If a statement exceeds 120 characters, it should be split into multiple statements.
- Should use an indent of 2 spaces.
- Should end in a single empty line.
- Should not have trailing spaces.
- There should be a single empty line before a documentation comment that spans multiple lines.
- There should be a single space before and after binary operators.
- There should not be any whitespace between a unary operator and its operand.
- Should not have whitespace after the
(
or before the)
.
- Should not have whitespace between the
[
and first element or last element and]
.- If the line exceeds 80 characters, each element may be placed on its own line and indented one level.
- Should have a single space between the last identifier and
{
. - Should have a single empty line after the
{
and before the}
.
- Should have a single space between the keyword and
(
or{
. - Should have a single space between the
)
and{
. - Should not have whitespace after the
(
or before the)
.
- Should have a single space between the
)
and{
.
- Should not have whitespace between the identifier and
(
. - Should not have whitespace between the
)
and;
.
- All class members except constructors must include a visibility modifier.
All statements must end in a semicolon.
Single-quoted strings should be used by default.
All variable declarations must use let
or const
.
- Only the first letter of acronyms should be uppercase.
- Should use
UpperCamelCase
. - Interfaces should start with an
I
. - Test classes should end with
Test
.
- Should use
lowerCamelCase
.
- Should use
lowerCamelCase
. - Should not start with an
_
unless it is protected or private and a public getter or setter exists with the same name.
- Should use
lowerCamelCase
.
- Should use
lowerCamelCase
.
Home
News
- Roadmap
Contributor Guide
Help