乐趣区

关于vue.js:vue-eslint报错解决

vue 我的项目执行 npm run serve 启动时报以下谬误(理论谬误很多,仅复制两个)

 error  in ./src/router/index.js

Module Error (from ./node_modules/eslint-loader/index.js):
error: Parsing error: Unexpected token import at src\router\index.js:11:26:
   9 |         path: '/',
  10 |         name: 'home',
> 11 |         component: () => import('@/views/home/Index'),
     |                          ^
  12 |         redirect: '/subscribe',
  13 |         children: [
  14 |             {


1 error found.

 error  in ./src/mixins/logoTitle.js

Module Error (from ./node_modules/eslint-loader/index.js):
error: Parsing error: Unexpected token getLogoTitle at src\mixins\logoTitle.js:3:15:
  1 | export default {
  2 |     methods: {> 3 |         async getLogoTitle() {
    |               ^
  4 |             this.setLogoAndTitle(this.$localstore.get('logoTitle'));
  5 |             await this.setLogoTitle();
  6 |         },


1 error found.

起因是 eslint 校验代码时 babel 还未解决代码,
在.eslintrc.js 中 extends: [], 删掉所有,只保留 ’plugin:vue/essential’ 一项

退出移动版