iview pro模板项目启动时报错:
token.type.endsWith is not a function
报错的原因是因为.eslintrc.js配置问题,parser对应的依赖不存在:
解决方法:换一下新的依赖:
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
"semi": [0],
'indent': 'off',
'vue/script-indent': [
'error',
4,
{
'baseIndent': 1
}
],
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'vue/no-parsing-error': [
2,
{
"x-invalid-end-tag": false
}
]
},
parserOptions: { parser: '@babel/eslint-parser'}
}
参考文献: