Eslint config utilising Airbnb-base, Prettier, Jest and TypeScript support.
Eslint config utilizing Airbnb-base, Prettier and Jest support.
Plugins and configs used:
Additionally, it sets these environments:
{
"env": {
"browser": true,
"node": true,
"jest": true,
"es6": true
}
}
yarn add --dev eslint @iroachie/eslint-config
Note: We're using yarn
to install deps. Feel free to change commands to use npm
3+ and npx
if you like
Add to your eslint config (.eslintrc
, or eslintConfig
field in package.json
):
{
"extends": "@iroachie"
}
Add the eslint extension for your editor. Example below is VSCode.
In your "User Settings" add the following lines:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
]
{
"extends": "@iroachie",
"rules": {
"global-require": 0,
"prefer-destructuring": 0
}
}
Optionally in your repo you can set up githooks to format your code when you make a commit. You can follow the setup over here.