@tokopedia/eslint-config
Shareable ESLint configuration for tokopedia web services.
@tokopedia/eslint-config is a shareable configuration package for eslint modified to meet tokopedia own standards.
Installation
$ npm i --save-dev eslint @tokopedia/eslint-config
$ yarn add --dev eslint @tokopedia/eslint-config
$ pnpm install --save-dev eslint @tokopedia/eslint-config
Also, this config requires you to install basic peer dependencies
npm i --save-dev eslint-plugin-tokopedia-lite eslint-plugin-import eslint-plugin-jest eslint-plugin-jest-dom eslint-plugin-json eslint-plugin-jsx-a11y eslint-plugin-prettier
Usage Overview
There are several ways to incorporate this eslint configuration into your project.
Step 1
Add this into your eslint configuration file
{
"extends": "@tokopedia/eslint-config"
}
Step 2 (Optional)
Select additional configurations. These require you to add dependencies to your project:
npm i --save-dev <additional deps>
.
Congiguration | Description | Additional Dependencies |
---|
@tokopedia/eslint-config/react | React.js and .jsx support | eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-svelte3 |
@tokopedia/eslint-config/svelte | Svelte support | eslint-plugin-svelte3 |
@tokopedia/eslint-config/typescript | TypeScript support | @typescript-eslint/parser @typescript-eslint/eslint-plugin |
NOTE: You must use a .eslintrc
file to specify multiple configurations. Set the
extends property to
an array containing the Target Environment and one or more addon configurations.