This is the eslint configuration used by Organization Consenlabs.
You can extend and inherit from it, please initiate an issue for any detailed changes.
Please make sure you have installed eslint
and version 5 or higher.
-
Install package:
yarn add @consenlabs-fe/eslint-config -D
-
Add the following code to the in-configuration file (
.eslintrc
):{ "extends": "@consenlabs-fe/eslint-config" }
OR, if you are using the
.yml
:extends: - '@consenlabs-fe/eslint-config'
-
If you are using
xo
, please refer to the following configuration:"xo": { "extends": [ "@consenlabs-fe/eslint-config" ] },
We always recommend that you use @typescript-eslint
instead of tslint
, as tslint
is now out of maintenance,
please at least make sure that you have the following dependencies installed:
eslint > 5.0
For more information on this please read the following links:
- Roadmap: TSLint -> ESLint (TSLint: Stop accepting any PRs at December 1st, 2020)
- TSLint in 2019
- Getting Started - Linting your TypeScript Codebase
- typescript-eslint repo
So naturally, we need to install dependencies before we begin:
-
Install package:
yarn add @consenlabs-fe/eslint-config-ts -D
-
Adding configuration to the
.eslintrc
file:"extends": ["@consenlabs-fe/eslint-config-ts"], "parserOptions": { "project": "./tsconfig.json" }
For React:
{
"extends": [
"@consenlabs-fe/eslint-config-ts",
"@consenlabs-fe/eslint-config-react"
],
"parserOptions": {
"project": "./tsconfig.json"
}
}