AlloyTeam / eslint-config-alloy

Progressive ESLint config for your React/Vue/TypeScript projects
https://alloyteam.github.io/eslint-config-alloy/
2.65k stars 317 forks source link

当前提供的库和vue命令行安装的库并不相同,是否同步为官方推荐的库? #261

Closed you-hengh closed 6 months ago

you-hengh commented 6 months ago
{
  "devDependencies": {
    "@rushstack/eslint-patch": "^1.7.2",
    "@tsconfig/node18": "^18.2.2",
    "@types/node": "^18.19.17",
    "@vitejs/plugin-vue": "^4.6.2",
    "@vue/eslint-config-prettier": "^8.0.0",
    "@vue/eslint-config-typescript": "^12.0.0",
    "@vue/tsconfig": "^0.5.1",
    "eslint": "^8.56.0",
    "eslint-plugin-vue": "^9.21.1",
    "prettier": "^3.2.5",
    "typescript": "~5.3.3",
    "vite": "^5.1.3",
    "vue-tsc": "^1.8.27"
  }
}

我是用pnpm 创建了vue3项目,在模板提示中 开启了eslint相关配置

上面是自动安装的eslint相关配置, 我留意到和当前项目推荐的库并不一致

是否应该同步官方所使用的库文件呢?

you-hengh commented 6 months ago

@xcatliu 有空看看吗?

xcatliu commented 6 months ago

@vue/eslint-config-typescript 这个是 vue cli 默认的 eslint 配置吧。这个配置是 vue 官方维护的,也挺适用的,如果不想折腾的话,可以就用官方这个。

不过 eslint 本身就是非常灵活的,也可以切换为 alloy 的配置,先把 @vue/eslint-config-typescripteslintrc 中的相关配置移除,然后添加 alloy 的 vue 规则就可以了