- Standard config base
- React plugin
- JSX a11y plugin
- Import helpers plugin
- Prettier
Install the dependencies:
npm i -D eslint @sup3r-us3r/eslint-config
Create a .eslintrc
file extending the config:
{
"extends": "@sup3r-us3r/eslint-config/react"
}
You can also use a
.eslintrc.json
or.eslintrc.js
.
Add lint
script in your package.json
to try fix all lint errors:
"scripts": {
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix"
}
Create .prettierrc
file in the root directory with below content:
{
"semi": true,
"singleQuote": true,
"arrowParens": "avoid",
"trailingComma": "all",
"endOfLine": "lf"
}
Or copy this config:
$ cp node_modules/@sup3r-us3r/eslint-config/.prettierrc .
Run the above command in your project root directory.
Create .editorconfig
file in the root directory with below content:
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
Or copy this config:
$ cp node_modules/@sup3r-us3r/eslint-config/.editorconfig .
Run the above command in your project root directory.