Sharable eslint config created and used by Valian
@typescript-eslint/eslint-plugin
eslint-config-airbnb
eslint-config-airbnb-typescript
eslint-config-prettier
eslint-plugin-eslint-comments
eslint-plugin-import
eslint-plugin-jest
eslint-plugin-jest-formatting
eslint-plugin-promise
eslint-plugin-simple-import-sort
eslint-plugin-unicorn
yarn add -D eslint @valian/eslint-config
or
npm install --save-dev eslint @valian/eslint-config
Add .eslintrc.js
:
module.exports = {
env: {
node: true,
},
extends: ['@valian/eslint-config/node'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
}
Add .eslintrc.js
:
module.exports = {
env: {
browser: true,
},
extends: ['@valian/eslint-config/react'],
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
settings: {
react: {
version: 'detect',
},
},
}