如果你想在 Vue 3 + Vite 项目中关闭 ESLint 报错 "Expected indentation of 2 spaces but found 4",你可以采取以下步骤:
-
找到你的 ESLint 配置文件,通常是
.eslintrc.js
。 -
在配置文件中添加一个
"rules"
部分,以关闭与缩进相关的规则。具体来说,你可以将"indent"
规则设置为"off"
或0
,以禁用缩进规则:// .eslintrc.js module.exports = { // 其他配置项... rules: { "indent": "off", // 或者 0 // 其他规则... } };
希望能够帮到您