@brucesong/eslint-config-react
Features
- [x] Suitable for React + TypeScript + TailwindCSS projects
- [x] Based on Airbnb JavaScript Style
- [x]
import
、export
auto sort - [x] TailwindCSS class name auto sort, merge
- [x] Resolving conflicts between
ESLint
andPrettier
- [x] Support storybook
- [x] Support using in Turborepo
- [x] Support defining
ESLINT_TSCONFIG
in the env to specify thetsconfig.json
file path used by ESLint - [x] Auto check
tsconfig.json
、tsconfig.eslint.json
file in the project root directory
tsconfig
About checking the priority of - If
ESLINT_TSCONFIG
is defined in the env, use the path specified in the env - If
tsconfig.eslint.json
exists in the project root directory, use this file - If
tsconfig.json
exists in the project root directory, use this file
Usage
Install
pnpm add -D eslint @brucesong/eslint-config-react
.eslintrc.json
Config {
"extends": "@brucesong/eslint-config-react"
}
package.json
Add script for {
"scripts": {
"lint": "eslint .",
"lint:fix": "eslint . --fix"
}
}
Config VSCode auto fix
{
"editor.codeActionsOnSave": {
"source.fixAll": false,
"source.fixAll.eslint": true,
"source.organizeImports": false
}
}
License
MIT License © 2023 Bruce Song