@hyperbolajs/eslint-config

wwwatson's personal eslint config

Usage

Install

Install eslint and prettier

$ npm install -D eslint prettier

Install @hyperbolajs/eslint-config

$ npm install -D @hyperbolajs/eslint-config

Edit package.json

{
    "eslintConfig": {
        "extends": "@hyperbolajs/eslint-config"
    }
}

Only broswer env

{
    "eslintConfig": {
        "extends": "@hyperbolajs/eslint-config/broswer"
    }
}

Only node env

{
    "eslintConfig": {
        "extends": "@hyperbolajs/eslint-config/node"
    }
}

With TypeScript

Install dependencies

$ npm install -D @typescript-eslint/parser @typescript-eslint/eslint-plugin

Base

{
    "eslintConfig": {
        "extends": "@hyperbolajs/eslint-config/ts"
    },
    "parserOptions": {
      "tsconfigRootDir": ".",
      "project": "tsconfig.json"
    }
}

Only node

{
    "eslintConfig": {
        "extends": "@hyperbolajs/eslint-config/ts-node"
    },
}

Only braswer

{
    "eslintConfig": {
        "extends": "@hyperbolajs/eslint-config/ts-broswer"
    },
}

With React

install dependencies

npm install -D eslint-plugin-react eslint-plugin-react-hooks
{
    "eslintConfig": {
        "extends": "@hyperbolajs/eslint-config/jsx"
    },
}

TypeScript

{
    "eslintConfig": {
        "extends": "@hyperbolajs/eslint-config/tsx"
    },
}