Skip to content

cuiqg/eslint-config

Repository files navigation

@cuiqg/eslint-config npm

使用

npm i -D eslint @cuiqg/eslint-config

修改 package.json 文件

{
+ "type": "module",
  "scripts": {
+   "lint": "eslint .",
+   "lint:fix": "eslint . --fix"
  }
}

创建 eslint.config.js 文件

import cuiqg from '@cuiqg/eslint-config'

export default cuiqg()

插件配置

安装 VS Code ESLint extension

创建配置文件 .vscode/settings.json

{
  "eslint.useFlatConfig": true,
  "prettier.enable": false,
  "editor.formatOnSave": false,
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": "explicit",
    "source.organizeImports": "never"
  }
}