-
Notifications
You must be signed in to change notification settings - Fork 0
Coding standards
Matt Acosta edited this page Nov 24, 2017
·
4 revisions
- Use an indent of 2 spaces.
- Lines should not have trailing whitespace.
- Text files should end in a single new line.
- Multi-line documentation comments should have a single leading new line.
- There should be a single space before and after binary operators.
- There should not be any whitespace between a unary operator and its operand.
- Control structures should have a single space between the keyword and
(
or{
. - Function calls should not have whitespace between:
- The identifier and
(
. - The
(
and the first parameter. - The last parameter and
)
. - The
)
and;
.
- The identifier and
- Array declarations should not have whitespace between the
[
and first element, or last element and]
, unless the line exceeds 80 characters, in which case each element should be placed on its own line and indented one level.
Single-quoted strings should be used by default.
All statements must end in a semicolon.
All variable declarations must use let
or const
.
- Should use
lowerCamelCase
.
- Should use
UpperCamelCase
. - Interfaces should start with
I
. - Test classes should end with
Test
. - Only the first letter of acronyms should be uppercase.
- Methods should use
lowerCamelCase
. - Properties should use
lowerCamelCase
.- If a getter or setter exists with the same name as a protected or private
property, the property may start with a
_
.
- If a getter or setter exists with the same name as a protected or private
property, the property may start with a
- All class members except constructors must include a visibility modifier.
Home
News
- Roadmap
Contributor Guide
Help