Change record status: 
Introduced in branch: 
Introduced in version: 

Previous JavaScript linting standards have been deprecated in favor of the more modern AirBnB standards. Their rules are more strict than ours, which is a good move for our codebase. The previous standards are contained in /core/.eslintrc.legacy.json.

How to configure your project for eslint

Core - ECMAScript 5 (legacy)

Run eslint based on legacy standards using the following shell command from the Drupal root directory:

cd core
yarn install
./node_modules/.bin/eslint --no-ignore --no-eslintrc --config=.eslintrc.legacy.json --ext=.js .

Core - ECMAScript 6

Run and automatically fix es6.js files using the following commands:

cd core
yarn install
yarn run lint:core-js

Non-Core - ECMAScript 5 (legacy)

If you wish to continue to utilize the legacy standards, you can run the legacy standards by running the following command from the root of the module you want to scan:

PATH/TO/DRUPAL_ROOT/core/node_modules/.bin/eslint --no-eslintrc -c=PATH/TO/DRUPAL_ROOT/core/.eslintrc.legacy.json --ext=.js .

Non-Core - ECMAScript 6

Extend /path/to/core/.eslintrc.json in your module, theme or project .eslintrc.json file. The path to the core eslint configuration file may differ depending on your project directory.

Core Patch Contributor Workflow

See [#2815083] for more detailed information about developing core JavaScript.

Module developers
Updates Done (doc team, etc.)
Online documentation: 
Not done
Theming guide: 
Not done
Module developer documentation: 
Not done
Examples project: 
Not done
Coder Review: 
Not done
Coder Upgrade: 
Not done
Other updates done