Skip to content

Style Guide

Justin Gaskins edited this page Jan 16, 2020 · 1 revision

Please refer to this guide while contributing to the project, in order to maintain a consistent and manageable codebase. Much of this guide will be similar to the Google JavaScript Style Guide, with slight differences. Adhering to these guidelines will also speed up the Pull Request process, as it will allow code reviewers to focus on code logic and accuracy instead of convention and style. Thank you!

Table of Contents

  1. Introduction
    a. Terminology
    b. Guide Notes
  2. Source File Basics
    a. File Name
  3. Source File Structure
    a. License or Copyright Information
    b. Exports
    c. File Implementation
  4. Formatting
    a. Braces
    b. Block Indentation
    c. Statements
    d. Column Limit
    e. Line Wrapping
    f. Whitespace
    g. Grouping Parentheses
    h. Comments
  5. Language Features
    a. Variable Declaration
    b. Array Literals
    c. Object Literals
    d. Classes
    e. Functions
    f. String Literals
    g. Number Literals
    h. Control Structures
    i. this
    j. Equality Checks
    k. Disallowed Features
  6. Naming
    a. Common Rules
    b. By Identifier Type
    c. Camel Case
  7. Documentation
    a. Commenting
    b. JSDoc
    c. Wiki Pages
  8. Policies
    a. Unspecified Issues
    b. Compiler Warnings
    c. Deprecation
    d. Other Coding Languages
    e. Local Style Rules
    f. Generated Code
  9. Appendices
    a. Commonly Misunderstood Rules
    b. Style Related Tools
    c. Exceptions

1. Introduction

Terminology

Guide Notes

2. Source File Basics

File Name

3. Source File Structure

License or Copyright Information

Exports

File Implementation

4. Formatting

Braces

Block Indentation

Statements

Column Limit

Line Wrapping

Whitespace

Grouping Parentheses

Comments

5. Language Features

Variable Declaration

Array Literals

Object Literals

Classes

Functions

String Literals

Number Literals

Control Structures

this

Equality Checks

Disallowed Features

6. Naming

Common Rules

By Identifier Type

Camel Case

7. Documentation

Commenting

JSDocs

Wiki Pages

8. Policies

Unspecified Issues

Compiler Warnings

Deprecation

Other Languages

Local Style Rules

Generated Code

9. Appendices

Commonly Misunderstood Rules

Style Related Tools

Exceptions