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 --save-dev
# or
yarn add eslint --dev

Once eslint is installed, you can use it by specifying eslint:recommended in the extends section of your ESLint configuration .

{
  "root": true,
  "extends": ["eslint:recommended"],
  "rules": {
    // Additional, per-project rules...
  }
}