0.0.11 • Published 3 months ago

@brucesong/eslint-config-next v0.0.11

Weekly downloads
-
License
MIT
Repository
github
Last release
3 months ago

@brucesong/eslint-config-next

Features

  • Suitable for Next + TypeScript + TailwindCSS projects
  • Based on Airbnb JavaScript Style
  • importexport auto sort
  • TailwindCSS class name auto sort, merge
  • Resolving conflicts between ESLint and Prettier
  • Support defining ESLINT_TSCONFIG in the env to specify the tsconfig.json file path used by ESLint
  • Auto check tsconfig.jsontsconfig.eslint.json file in the project root directory

About checking the priority of tsconfig

  1. If ESLINT_TSCONFIG is defined in the env, use the path specified in the env
  2. If tsconfig.eslint.json exists in the project root directory, use this file
  3. If tsconfig.json exists in the project root directory, use this file

Usage

Install

pnpm add -D eslint @brucesong/eslint-config-next

Config .eslintrc.json

{
  "extends": "@brucesong/eslint-config-next"
}

Add script for package.json

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

Config VSCode auto fix

{
  "editor.codeActionsOnSave": {
    "source.fixAll": false,
    "source.fixAll.eslint": true,
    "source.organizeImports": false
  }
}

License

MIT License © 2023 Bruce Song