npm install --save-dev babel-eslint eslint eslint-config-airbnb eslint-plugin-react eslint-config-prettier eslint-plugin-prettier prettier
So we need a file on our react project's root called ".eslintrc". Now here we are going to write as a common JSON file, lots of people have different eslint settings, but I have come to see that this ones are easy and straight forward.
Once again we need a file on our react project's root called ".prettierrc". And here too we are going to write as a common JSON file, lots of people have different prettier settings, but I have come to see that this ones are easy and straight forward.
// This is your .prettierrc file
{
"printWidth": 100,
"tabWidth": 2,
"singleQuote": false,
"jsxBracketSameLine": true,
"trailingComma": "es5"
}
Actually this is the shortest of all the blog, you just need to install to extensions to your vs code.
- Eslint (dbaeumer.vscode-eslint)
- Prettier (esbenp.prettier-vscode)