Airbnb style configuration for Eslint, prettier support for react and non-react projects.
First, install the package using the following command:
npm i -D eslint-config-pretty-airbnb
Then create a file named .eslintrc
with following contents in the root folder of your project:
{
"extends": "pretty-airbnb/no-react"
}
or for short:
{
"extends": "pretty-airbnb"
}
this configuration that i use when working on non react
project. this setup is mix of
airbnb-base
rules and plugin:prettier/recommended
.
If you want to use it when developing an react project then use this config instead:
{
"extends": "pretty-airbnb/yes-react"
}
Then in the vscode settings copy and paste the following settings:
"editor.formatOnSave": true,
"[javascript]": {
"editor.formatOnSave": false
},
"eslint.autoFixOnSave": true,
"eslint.alwaysShowStatus": true,
"prettier.disableLanguages": [
"js"
],
"files.autoSave": "onFocusChange",