eslint 设置 warning 级别,在 开发编译失败的原因,报错如下:

  1. F:\vue-mobile-skeleton>npm run dev
  2.  
  3. > byhealth@1.0.0 dev F:\vue-mobile-skeleton
  4. > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
  5.  
  6. 94% asset optimization
  7.  
  8. ERROR Failed to compile with 1 errors 22:51:17
  9.  
  10. error in ./src/app.vue
  11.  
  12. Module build failed: Module failed because of a eslint warning.
  13.  
  14. http://eslint.org/docs/rules/no-unused-vars 'o' is assigned a value but never used
  15. src\app.vue:60:7
  16. const o = 90;
  17. ^
  18.  
  19. 1 problem (0 errors, 1 warning)
  20.  
  21. Warnings:
  22. 1 http://eslint.org/docs/rules/no-unused-vars
  23.  
  24. @ ./src/main.js 12:0-28
  25. @ multi (webpack)-dev-server/client?http://localhost:8080 webpack/hot/dev-server ./src/main.js

Module build failed: Module failed because of a eslint warning的原因,为自己当时即使是eslint 设置 warning 规则,在热更新都会报错,无法编译通过的! 

解决:

1:把这个没有使用变量,删除

2:使用 注释方式不进行检测 => // eslint-disable-next-line

3:把  eslint-laoder 的选项设置 fasle 即可;

  1. // 目录:/build/webpack.base.conf.js
  2.  
  3. const createLintingRule = () => ({
  4. test: /\.(js|vue)$/,
  5. loader: 'eslint-loader',
  6. enforce: 'pre',
  7. include: [resolve('src'), resolve('test')],
  8. options: {
  9. formatter: require('eslint-friendly-formatter'),
  10. emitError:false,
  11. emitWarning: config.dev.showEslintErrorsInOverlay,
  12. fix: true,
  13. failOnError: true,
  14. //如果有eslint警告,加载器将导致模块构建失败。
  15. //设置 false 即可,去除此检验
  16. failOnWarning: false,
  17. }
  18. })

但是,还是看个人喜好,若是单单在控制台提示警告也可以,不过我本人不想看到有警告,所以就硬性设为 true 不让编译通过,个人喜爱而已!

Module build failed: Module failed because of a eslint warning的更多相关文章

  1. vue-cli 报Module build failed: Error: No parser and no file path given, couldn't infer a parser.错的解决方法

    出错提示如下: ERROR Failed to compile with errors :: error in ./src/App.vue Module build failed: Error: No ...

  2. vue.js报错:Module build failed: Error: No parser and no file path given, couldn't infer a parser.

    ERROR Failed to compile with 2 errors 12:00:33 error in ./src/App.vue Module build failed: Error: No ...

  3. 配置web pack loader 报错:Module build failed: Error: The node API for `babel` has been moved to `babel-core`.

    报错如下 Module build failed: Error: The node API for `babel` has been moved to `babel-core`. 在我配置loader ...

  4. Vue使用Typescript开发编译时提示“ERROR in ./src/main.ts Module build failed: TypeError: Cannot read property 'afterCompile' of undefined”的解决方法

    使用Typescript开发Vue,一切准备就绪.但npm start 时,提示“ ERROR in ./src/main.tsModule build failed: TypeError: Cann ...

  5. webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find module 'babel-preset-env' from '...' - Did you mean "@babel/env"?

    webpack报错:Module build failed (from ./node_modules/babel-loader/lib/index.js): Error: Cannot find mo ...

  6. Module build failed: Error: Cannot find module 'url-loader' 的坑

    本文地址:http://www.cnblogs.com/jying/p/8280956.html 开发环境:react.webpack.es5 引用图片报错:Module build failed: ...

  7. Vue, element-ui Module build failed: Error: No PostCSS Config found

    使用vue框架写pc页面时,我们经常会用到element-ui这个框架. 当我们吧把需要的东西都装在好运行项目的时候,有时会出现这样的错误, Module build failed: Error: N ...

  8. Vue+Webpack配置css-loader时报错:Module build failed: Unknown word

    使用Vue+Webpack搭建工程时,在webpack.config.js中的module的rules里针对各种文件配置加载工具.在针对css文件配置时遇到一个问题:打包构建时报错——Module b ...

  9. Module build failed: Error: Cannot find module 'node-sass'

    安装npm 遇到 Module build failed: Error: Cannot find module 'node-sass' 这次通过重装 npm 完成 先卸载npm npm uninsta ...

随机推荐

  1. Codeforces Round #471 (Div. 2)A. Feed the cat

    After waking up at hh:mm, Andrew realised that he had forgotten to feed his only cat for yet another ...

  2. Java IO 流总结

    Java流操作有关的类或接口: Java流类图结构: 流的概念和作用 流是一组有顺序的,有起点和终点的字节集合,是对数据传输的总称或抽象.即数据在两设备间的传输称为流,流的本质是数据传输,根据数据传输 ...

  3. JavaScript CSS 实现简单的 TAB 标签切换

    使用CSS隐藏所有tab页,然后使用JavaScript给选中的元素对应ID的tab页设置class="active"类来显示该元素,以此实现tab切换. 如鼠标放置到shwww时 ...

  4. robot Framework控制浏览器

    向下 向上为负值

  5. sw算法求最小割学习

    http://  blog.sina.com.cn/s/blog_700906660100v7vb.html 转载:http://www.cnblogs.com/ylfdrib/archive/201 ...

  6. 统制Highcharts中x轴和y轴坐标值的密度

    统制Highcharts中x轴和y轴坐标值的密度 www.MyException.Cn 发布于:2012-06-26 10:04:13 浏览:688次 1 控制Highcharts中x轴和y轴坐标值的 ...

  7. PHP 防xss攻击

    PHP直接输出html的,可以采用以下的方法进行过滤: 1.htmlspecialchars函数 2.htmlentities函数 3.HTMLPurifier.auto.php插件 4.Remove ...

  8. cogs 969. [NOIP2006] 数列

    969. [NOIP2006] 数列 ★☆   输入文件:sequenc.in   输出文件:sequenc.out   简单对比时间限制:1 s   内存限制:162 MB 题目描述 给定一个正整数 ...

  9. ScrollView+RadioGroup

    今天要分享一下关于动态添加RadioButton的东西: 要实现的效果就是,这个控件可以左右滑动,里面的按钮都是互斥的,类似RadioButton,我的第一反应就是用ScrollView+RadioG ...

  10. android setCookie 免登录

    CookieSyncManager.createInstance(getActivity()); CookieManager cookieManager = CookieManager.getInst ...