1.0.21 • Published 2 years ago

eslint-config-haku v1.0.21

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

🍃 Haku's Eslint Config

🦴 Setup Project

Installation

  • Install eslint-config-haku

    npm i --save-dev eslint-config-haku
    yarn add -D eslint-config-haku
    pnpm add -D eslint-config-haku
  • Extend the config in .eslintrc.js

    // Extend the config matching your project
    extends: ["haku/react"],
    parserOptions: {
        // Warn: the location may differ in different project structure
        project: "./tsconfig.json",
    },

VSCode

  • setup to auto fix lint problems on save
    # .vscode/config.json
    {
      "editor.codeActionsOnSave": { "source.fixAll": true },
      "editor.formatOnSave": false
    }

🥑 Recipes

Linting with Type Information

Redux

  • Refer to https://redux.js.org/usage/usage-with-typescript#define-typed-hooks
  • Add rule to restrict using custom useAppSelector and useAppDispatch for typing
    "@typescript-eslint/no-restricted-imports": [
      "warn",
      {
        name: "react-redux",
        importNames: ["useSelector", "useDispatch"],
        message: "Use typed hooks `useAppDispatch` and `useAppSelector` instead.",
      },
    ],

🍳 Trouble Shooting

Can't resolve paths alias in monorepo projects

1.0.21

2 years ago

1.0.20

2 years ago

1.0.18

2 years ago

1.0.17

2 years ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.12

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2-beta

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago