Vue 项目启动抛出 Module build failed/ Error/ No ESLint configuration found.

出现错误的原因
因为项目根路径缺少 ESLint 的配置文件
解决问题的方式
将 ESLint 相关配置文件添加至项目根路径
文件名 .eslintrc.js
// https://eslint.org/docs/user-guide/configuring

module.exports = {
  root: true,
  parser: 'babel-eslint',
  parserOptions: {
    sourceType: 'module'
  },
  env: {
    browser: true,
  },
  // https://github.com/standard/standard/blob/master/docs/RULES-en.md
  extends: 'standard',
  // required to lint *.vue files
  plugins: [
    'html'
  ],
  // add your custom rules here
  'rules': {
    // allow paren-less arrow functions
    'arrow-parens': 0,
    // allow async-await
    'generator-star-spacing': 0,
    // allow debugger during development
    'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
    // 忽略函数空格检测
    'space-before-function-paren': 0,
    // 中缀操作符周围要不要有空格
    'space-infix-ops': 0,
    'no-trailing-spaces': 0,
    'new-parens': 0
  }
}
————————————————
版权声明:本文为CSDN博主「asing1elife」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/asing1elife/article/details/82766847

发布了21 篇原创文章 · 获赞 113 · 访问量 146万+

猜你喜欢

转载自blog.csdn.net/hsany330/article/details/105138555