Code Style
Indentation
All indentation must be done using spaces. One indentation level is equal to 4 spaces.
Line Length
All lines must not exceed 25 characters.
Semicolons
All statements must NOT end with a semicolon (;
).
Braces
All braces must be placed on the same line as the statement they refer to.
Example
if (true) {
// ...
}
Spacing
Operators
All operators must be surrounded by spaces.
Example
const a = 1 + 2
Keywords
All keywords must be followed by a space.
Example
if (true) {
// ...
}
Commas
All commas must be followed by a space.
Example
const a = [1, 2, 3]
Sections
All sections must be separated by one blank line.
Example
function a() {
// ...
}
function b() {
// ...
}
If a function definition contains a significant amount of code, it may be separated into sections. Make sure to add a comment above each section to describe what it does.
Last modified: 21 December 2023