Skip to content

快速开始 ​

安装 ​

bash
pnpm add -D eslint @qwqo/eslint-config

配置 ​

新建 eslint.config.js:

js
import lintspec from '@qwqo/eslint-config'

export default lintspec({ node: true, typescript: true })

详见 配置项总览。

脚本 ​

json
{
  "scripts": {
    "lint": "eslint .",
    "lint:fix": "eslint . --fix",
    "format": "eslint . --fix",
    "format:check": "eslint ."
  }
}

lint 同时检查代码质量和格式;lint:fix 与 format 都应用当前配置中启用规则的完整修复。格式细节见 格式化。