@secondcloset/eslint-config-react
v1.2.3
Published
Eslint configuration for react typescript projects
Downloads
209
Maintainers
Keywords
Readme
Secondcloset eslint-config-react
Installation
Run the following command:
npm i --save-dev @secondcloset/eslint-config-react @secondcloset/prettier-config
How to use
- In your react project, create an
.eslintrc.js
file and add these changes:
module.exports = {
extends: ["@secondcloset/react"],
parserOptions: {
project: "./tsconfig.json",
}
};
- Add these packages in your repo's package.json
devDependencies
attribute:
"@typescript-eslint/parser": "^4.33.0",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-config-react": "^1.1.7",
"eslint-config-react-app": "^6.0.0",
"eslint-plugin-import": "^2.25.2",
"eslint-plugin-react-hooks": "^4.2.0",
"prettier": "^2.4.1"
- Add these scripts in your repo's package.json
scripts
attribute:
"lint": "eslint src --ext .js,.ts,.tsx",
"lint:fix": "eslint src --ext .js,.ts,.tsx --fix",
- Install the newly added packages:
npm install
- Add the prettier config to your package.json file:
"prettier": "@secondcloset/prettier-config"
- Test the configuration:
npm run lint