⛔️ DEPRECATION WARNING
This library is deprecated and will be archived.
Its functionality has been moved into a new package, @edx/eslint-config, which should be used for frontend linting going forward. Please contact @edx/fedx-team with any questions.
edX ESLint configs
ESLint configs for edX JavaScript code.
Table of Contents
Overview
In order to standardize and enforce edX's JavaScript coding style across multiple codebases, edX has adopted ESLint and these shared ESLint configs. Two configs are published from this repository:
-
eslint-config-edx
, for linting ES2015+ code -
eslint-config-edx-es5
, for linting ES5 code
License
The code in this repository is released under the Apache 2.0 license unless otherwise noted. Please see the LICENSE file for details.
Dependencies
ESLint is required to use either config, and NodeJS 4.0 or greater is required to use ESLint. Both configs are tested with the Node version bundled in the most recent edX devstack setup.
Usage
To begin using the edX ESLint configs in a codebase, install the desired config from NPM:
npm install --save-dev eslint-config-edx
or
npm install --save-dev eslint-config-edx-es5
Then, configure your project's ESLint config to extend eslint-config-edx
or eslint-config-edx-es5
(see the ESLint docs on Using a Shareable Config). If you do not plan on adding custom rules beyond those in eslint-config-edx
to your project, the easiest place to configure this is probably in your package.json
:
"devDependencies": {
"eslint-config-edx": "^2.0.0"
},
"eslintConfig": {
"extends": "eslint-config-edx"
}
If you plan on adding additional customization, you can configure your project with an .eslintrc.js
/.eslintrc.json
file.
The Configs
More documentation on the rules specified by each config is available in: