问题:
1 2 3 4 5 6 7 8 9 10 11 12 |
Module Warning (from ./node_modules/eslint-loader/index.js): error: Parsing error: Unexpected token import at src\views\member\config.js:10:22: 8 | requireAuth: false, 9 | nav: true, > 10 | component: () => import(`@/views/${module}/Index.vue`), | ^ 11 | jsSign: true, 12 | keepAlive: true 13 | } 1 error found. |
解决:
在eslint配置文件添加配置:
1 2 3 |
"parserOptions": { "parser": "babel-eslint" } |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
.eslintrc.json { "parserOptions": { "ecmaVersion": 2017, "sourceType": "module" }, "extends": ["eslint:recommended", "plugin:vue/essential", "prettier"], "plugins": ["prettier"], "rules": { "prettier/prettier": ["error"] }, // "parser": "vue-eslint-parser", "env": { "browser": true, "node": true, "es6": true, "mocha": false, "jest": false }, "parserOptions": { "parser": "babel-eslint" } } |