1.0.2 • Published 2 years ago
@technohiru/eslint-config-react v1.0.2
ESLint Config for React
What's Included?
- Recommended rules from eslint, prettier, react, react-hooks and react-refresh;
- Prettier;
- React Plugin;
- React Hooks Plugin;
- React Refresh Plugin;
- Simple Import Sort Plugin.
Installation and Usage
- Install the package, as well as it's dependecies, as dev dependency:
$ npm i --save-dev @technohiru/eslint-config-react eslint prettier eslint-config-prettier eslint-plugin-prettier eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-react-refresh eslint-plugin-simple-import-sort- Extend the default configuration file in the
.eslintrc.{json|js}file:
.eslintrc.json
{
"extends": ["@technohiru/eslint-config-react/default.js"]
}.eslintrc.js
module.exports = {
extends: ["@technohiru/eslint-config-react/default.js"],
};- Add these configurations to VS Code
settings.jsonfile for auto-fixing after every save:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript", "javascriptreact"](This ensures that simple-import-sort will be executed properly.)