iview pro 项目报错token.type.endsWith is not a function

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'}
}

参考文献:

iview pro项目报错token.type.endsWith is not a function - 哔哩哔哩

猜你喜欢

转载自blog.csdn.net/qq_42740797/article/details/124750728
今日推荐