iRoachie / eslint-config

Eslint config utilising Airbnb-base, Prettier, Jest and TypeScript support.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@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.

In your "User Settings" add the following lines:

"editor.codeActionsOnSave": {
  "source.fixAll.eslint": true
},
"eslint.validate": [
  "javascript",
  "javascriptreact",
  "typescript",
  "typescriptreact"
]

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.

About

Eslint config utilising Airbnb-base, Prettier, Jest and TypeScript support.


Languages

Language:JavaScript 99.3%Language:TypeScript 0.7%