2.2.0 • Published 5 days ago

eslint-config-hyoban v2.2.0

Weekly downloads
-
License
MIT
Repository
github
Last release
5 days ago

eslint-config-hyoban

npm version npm downloads License

Hyoban's ESLint Config, enable most of the recommended rules for js, ts, and react.

BasicStyleReactOthers
jsstylisticreactTailwind CSS
tsantfuhooksUnoCSS
unicornimport-sortrefreshflat-gitignore
import-xjsoncjsx-nestingconfig-inspector
unused-importymljsx-a11y@antfu/eslint-config
nperfectionistnexteslint-types
compatformatpackage-json
eslint-typegen

Usage

ni -D eslint eslint-config-hyoban

eslint.config.js or eslint.config.mjs

// @ts-check
import hyoban from "eslint-config-hyoban";

export default hyoban();

!WARNING If your ESLint version is less than 8.57.0, you have to use eslint.config.js.

module.exports = (async () => (await import("./eslint.config.mjs")).default)();

scripts in package.json

{
  "scripts": {
    "lint": "eslint",
    "lint:fix": "eslint --fix"
  }
}

If you need Prettier

{
  "scripts": {
    "lint": "prettier --list-different . && eslint",
    "lint:fix": "prettier --list-different --write . && eslint --fix"
  }
}

!WARNING If your ESLint version is less than 9.0.0, you have to use eslint . instead of eslint.

settings.json for VSCode

{
  // If you need Prettier
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,

  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
  },

  "eslint.experimental.useFlatConfig": true,
  "eslint.probe": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "json",
  ],
}

!TIP You can use prettier-config-hyoban for Prettier to avoid conflicts.

Auto fix for Pull Request

name: Format

on:
  pull_request:
    branches:
      - main

jobs:
  format-code:
    runs-on: ubuntu-latest

    permissions:
      # Give the default GITHUB_TOKEN write permission to commit and push the
      # added or changed files to the repository.
      contents: write

    steps:
      - uses: actions/checkout@v4

      - name: Set node
        uses: actions/setup-node@v4
        with:
          node-version: lts/*

      - name: Install pnpm
        uses: pnpm/action-setup@v3
        with:
          run_install: |
            - args: [--frozen-lockfile]

      - name: Lint
        run: pnpm run lint:fix

      # Commit all changed files back to the repository
      - uses: stefanzweifel/git-auto-commit-action@v5
2.2.0

5 days ago

2.1.1

8 days ago

2.0.0

14 days ago

2.1.0

14 days ago

1.0.2

15 days ago

1.0.3

15 days ago

1.0.1

22 days ago

1.0.0

22 days ago

0.7.8

22 days ago

0.7.7

23 days ago

0.7.2

24 days ago

0.7.1

24 days ago

0.7.4

24 days ago

0.7.3

24 days ago

0.5.0

24 days ago

0.7.0

24 days ago

0.5.1

24 days ago

0.7.6

24 days ago

0.7.5

24 days ago

0.6.0

24 days ago

0.4.1

26 days ago

0.4.2

26 days ago

0.4.0

29 days ago

0.3.2

1 month ago

0.3.1

1 month ago

0.3.0

1 month ago

0.2.17

1 month ago

0.2.16

1 month ago

0.2.15

1 month ago

0.2.14

1 month ago

0.2.13

1 month ago

0.2.12

1 month ago

0.2.11

1 month ago

0.2.10

1 month ago

0.2.9

1 month ago

0.2.8

1 month ago

0.2.7

2 months ago

0.2.6

2 months ago

0.2.3

2 months ago

0.2.5

2 months ago

0.2.4

2 months ago

0.2.1

2 months ago

0.2.0

2 months ago

0.2.2

2 months ago

0.1.34

2 months ago

0.1.35

2 months ago

0.1.36

2 months ago

0.1.37

2 months ago

0.1.38

2 months ago

0.1.39

2 months ago

0.1.30

2 months ago

0.1.31

2 months ago

0.1.32

2 months ago

0.1.33

2 months ago

0.1.28

2 months ago

0.1.29

2 months ago

0.1.27

2 months ago

0.1.26

2 months ago

0.1.25

2 months ago

0.1.24

2 months ago

0.1.23

2 months ago

0.1.15

2 months ago

0.1.20

2 months ago

0.1.21

2 months ago

0.1.22

2 months ago

0.1.16

2 months ago

0.1.17

2 months ago

0.1.18

2 months ago

0.1.19

2 months ago

0.1.11

3 months ago

0.1.12

2 months ago

0.1.13

2 months ago

0.1.14

2 months ago

0.1.10

3 months ago

0.1.8

3 months ago

0.1.9

3 months ago

0.1.7

3 months ago

0.1.4

3 months ago

0.1.6

3 months ago

0.1.5

3 months ago

0.1.3

3 months ago

0.1.2

3 months ago

0.1.1

3 months ago

0.1.0

3 months ago