例如如下错误:其实与代码无关
error in ./src/App.vue Module Error (from ./node_modules/eslint-loader/index.js): D:\workspace\test\element-plus-test\src\App.vue 1:1 error Parsing error: Unexpected token < ✖ 1 problem (1 error, 0 warnings)
解决办法:
1. 安装eslint-plugin-vue插件
npm install eslint-plugin-vue -D
2.在.eslint.js配置文件中添加如下配置:
module.exports = { root: true, parserOptions: { "ecmaVersion": 7, sourceType: 'module' }, "parser": "vue-eslint-parser", // 添加这一句 rules: { "@typescript-eslint/explicit-module-boundary-types":"off" } }