JavaScript Code Style

Reference Code Standard

Exceptions to the Standard

The one exception is that preexisting libraries included in your applications should not be changed to fit the standard. Hopefully you’re extending a library and able to craft the extension in a standardized format.

Implementing the Standard

Some IDE’s provide linting support built into their package system. For command-line you’ll need to install the package with administrative/root privilege

npm install eslint eslint-config-google --save-dev
# or
yarn add eslint eslint-config-google --dev

Once the eslint-config-google package is installed, you can use it by specifying google in the extends section of your ESLint configuration .

{
  "extends": "google",
  "rules": {
    // Additional, per-project rules...
  }
}