@iroachie/eslint-config
v0.0.3
Published
ESLint preset extending Airbnb, Prettier and Jest
Downloads
7
Readme
@iroachie/eslint-config
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
}
}
Installation
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
Usage
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.
- eslint - https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint
In your "User Settings" add the following lines:
"eslint.autoFixOnSave": true,
"editor.formatOnSave": false,
"eslint.validate": [
{
"language": "javascript",
"autoFix": true
},
{
"language": "javascriptreact",
"autoFix": true
},
{
"language": "typescript",
"autoFix": true
},
{
"language": "typescriptreact",
"autoFix": true
}
],
Example of extending the configuration
{
"extends": "@iroachie",
"rules": {
"global-require": 0,
"prefer-destructuring": 0
}
}
Advanced Usage
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.