eslint config for create-react-app
npm install --save-dev eslint-config-react-jsone
yarn add -D eslint-config-react-jsone
- remove eslintConfig in
package.json
- create
.eslintrc
file in root directory
{
"extends": "react-jsone"
}
create .prettierrc
file into root directory
{
"printWidth": 80,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"semi": false,
"trailingComma": "es5",
"bracketSpacing": true,
"arrowParens": "avoid",
"endOfLine": "auto",
"overrides": [
{
"files": ["*.css", "*.less", "*.scss"],
"options": {
"singleQuote": false
}
}
]
}
Add code below into .vscode/settings.json
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
}