Skip to content

Latest commit

 

History

History
180 lines (129 loc) · 4.68 KB

README.md

File metadata and controls

180 lines (129 loc) · 4.68 KB

Zoro's ESLint Configuration

A fully customized ESLint configuration based on the default ESLint, React and TypeScript rules

GitHub License Build Status NPM Downloads

Based on

Usage

This package contains six configurations for your usage:

  1. default: Consists of all the rules.
  2. eslint: Consists of the ESLint rules.
  3. react: Consists of the React rules.
  4. typescript: Consists of the TypeScript rules.
  5. node: Consists of the Node rules.
  6. stylistic: Consists of the Stylistic rules.

The simplest usage is to extend the default configuration in your .eslintrc.json as the followings:

{
    "extends": "eslint-config-zoro"
}

You can also extend with any combination of the last five rules, such as:

{
    "extends": [
        "eslint-config-zoro/eslint",
        "eslint-config-zoro/react",
        "eslint-config-zoro/stylistic",
        "eslint-config-zoro/typescript"
    ]
}

1. eslint-config-zoro

This is the default configuration which contains all the rules.

  1. Install:

    npm i -D eslint-config-zoro eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin eslint-plugin-react eslint-plugin-react-hooks eslint-plugin-node
  2. Add to your .eslintrc.json file:

    {
        "extends": "eslint-config-zoro"
    }

2. eslint-config-zoro/eslint

This configuration only contains the ESLint rules.

  1. Install:

    npm i -D eslint-config-zoro eslint
  2. Add to your .eslintrc.json file:

    {
        "extends": "eslint-config-zoro/eslint"
    }

3. eslint-config-zoro/react

This configuration only contains the React rules.

  1. Install:

    npm i -D eslint-config-zoro eslint eslint-plugin-react eslint-plugin-react-hooks
  2. Add to your .eslintrc.json file:

    {
        "extends": "eslint-config-zoro/react"
    }

4. eslint-config-zoro/typescript

This configuration only contains the TypeScript rules.

  1. Install:

    npm i -D eslint-config-zoro eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin
  2. In your .eslintrc.json file, add:

    {
        "extends": "eslint-config-zoro/typescript"
    }

5. eslint-config-zoro/node

This configuration only contains the Node rules.

  1. Install:

    npm i -D eslint-config-zoro eslint eslint-plugin-node
  2. In your .eslintrc.json file, add:

    {
        "extends": "eslint-config-zoro/node"
    }

6. eslint-config-zoro/stylistic

This configuration only contains the Stylistic rules.

  1. Install:

    npm i -D eslint-config-zoro eslint @stylistic/eslint-plugin
  2. In your .eslintrc.json file, add:

    {
        "extends": "eslint-config-zoro/stylistic"
    }

Where to ask for help?