1. npm i -D prettier
}
2. create .prettierrc.json
{
"trailingComma": "all",
"tabWidth": 2,
"singleQuote": true,
"jsxBracketSameLine": true,
"trailingComma": "all",
"tabWidth": 2,
"singleQuote": true,
"jsxBracketSameLine": true,
"semi": false
}
3. npm i -D eslint-config-prettier
4. in package.json, add this:
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest",
"prettier"
]
},
"extends": [
"react-app",
"react-app/jest",
"prettier"
]
},
5. install extension in VS Code
Prettier extension