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()
创建配置文件 .vscode/settings.json
{
"eslint.useFlatConfig": true,
"prettier.enable": false,
"editor.formatOnSave": false,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.organizeImports": "never"
}
}