@edx/eslint-config
Version:
ESLint configuration for edX JavaScript code.
36 lines (24 loc) • 2.01 kB
Markdown
[](https://github.com/openedx/eslint-config/actions/workflows/release.yml/)
[](https://www.npmjs.com/package/@edx/eslint-config)
[](https://www.npmjs.com/package/@edx/eslint-config)
[](https://github.com/openedx/eslint-config/blob/master/LICENSE)
[](https://github.com/semantic-release/semantic-release)
# @edx/eslint-config
## Installation
If you're using @edx/frontend-build, then you'll get this package for free. Otherwise, you can install it via:
```shell
npx install-peerdeps --dev @edx/eslint-config
```
This will install the package and all of its peer dependencies.
Then, once it's installed, create an `.eslintrc.js` file in the top-level directory of your project with the following contents:
```js
module.exports = {
extends: "@edx/eslint-config",
}
```
### Using TypeScript
If `@edx/eslint-config` detects a `tsconfig.json` file in the root folder of your project, it will optionally configure ESLint to add support for TypeScript. If a `tsconfig.json` file exists, the ESLint config will:
* Extend `airbnb-typescript` ([source](https://www.npmjs.com/package/eslint-config-airbnb-typescript)).
* Configure `parserOptions.project` to point to the `tsconfig.json` file in the root folder of your project.
`airbnb-typescript` may only be extended if a `tsconfig.json` file exists in your project.
If your `tsconfig.json` file is defined somewhere other than the root folder of your project, you may override the default ESLint configuration by extending `airbnb-typescript` and including the path to your `tsconfig.json` file in the `parserOptions.project` ESLint configuration.