code --install-extension dbaeumer.vscode-eslint
code --install-extension esbenp.prettier-vscode
code --install-extension rvest.vs-code-prettier-eslint
Add .eslintrc
, .prettierrc
, package.json
files in root folder of your project
Open settings.json
and add these lines to the end of file:
{
"editor.formatOnSave": true,
"editor.formatOnPaste": false,
"eslint.run": "onSave",
"editor.codeActionsOnSave": {
"source.fixAll": "always"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[jsx]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}