Giter Site home page Giter Site logo

eslint-config-hyoban's Introduction

eslint-config-hyoban

npm version npm downloads License

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

Basic Style React Others
js stylistic react Tailwind CSS
ts antfu hooks UnoCSS
unicorn import-sort refresh flat-gitignore
import-x jsonc jsx-nesting config-inspector
unused-import yml jsx-a11y @antfu/eslint-config
n perfectionist next eslint-types
compat format command
package-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)();

Tip

If you find that saving files in the editor is a bit laggy, try turning off rules that require type checking while in the editor.

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

const isInEditor = !!(
  (process.env.VSCODE_PID ||
    process.env.VSCODE_CWD ||
    process.env.JETBRAINS_IDE ||
    process.env.VIM) &&
  !process.env.CI
);

export default hyoban({
  typeChecked: isInEditor ? false : "essential",
});

scripts in package.json

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

Warning

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

If you need Prettier

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

Tip

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

.vscode/settings.json for VSCode.

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

  // You may don't need this in the future
  "eslint.experimental.useFlatConfig": true,
  "eslint.probe": [
    "javascript",
    "javascriptreact",
    "typescript",
    "typescriptreact",
    "json"
  ],

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

.zed/settings.json for Zed, read more at Zed's documentation and related PR.

{
  "formatter": {
    "code_actions": {
      "source.fixAll.eslint": true
    }
  }
}

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

eslint-config-hyoban's People

Contributors

hyoban avatar github-actions[bot] avatar renovate[bot] avatar dependabot[bot] avatar

Stargazers

Zhazha_JiaYiZhen avatar  avatar

Watchers

 avatar

eslint-config-hyoban's Issues

How I can contribute to your project

I am kamal Joshi and I am new to tech and want to contribute to your project.How I can do that.Please reply as I also love web developement a lot.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Awaiting Schedule

These updates are awaiting their schedule. Click on a checkbox to get an update now.

  • chore(deps): update dependency bunchee to ^5.0.1

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/setup-node v4
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/format.yml
  • actions/checkout v4
  • actions/setup-node v4
  • stefanzweifel/git-auto-commit-action v5
.github/workflows/release.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • @antfu/install-pkg ^0.3.2
  • @stylistic/eslint-plugin ^1.7.0
  • eslint-flat-config ^1.1.12
  • eslint-plugin-antfu ^2.1.2
  • eslint-plugin-format ^0.1.0
  • eslint-plugin-hyoban ^0.2.7
  • eslint-plugin-import-x ^0.4.4
  • eslint-plugin-jsonc ^2.14.1
  • eslint-plugin-simple-import-sort ^12.0.0
  • eslint-plugin-unicorn ^51.0.1
  • jsonc-eslint-parser ^2.4.0
  • local-pkg ^0.5.0
  • prompts ^2.4.2
  • typescript-eslint ^7.4.0
  • @eslint-react/eslint-plugin 1.5.7
  • @total-typescript/ts-reset ^0.5.1
  • @types/eslint ^8.56.6
  • @types/prompts ^2.4.9
  • bunchee ^5.0.0
  • eslint ^8.57.0
  • eslint-plugin-react-hooks ^4.6.0
  • eslint-typegen ^0.1.6
  • tsx ^4.7.1
  • typescript ^5.4.3
  • vitest ^1.4.0
  • pnpm 8.15.5

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.