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

F:\vue-mobile-skeleton>npm run dev

> byhealth@1.0.0 dev F:\vue-mobile-skeleton
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js 94% asset optimization ERROR Failed to compile with 1 errors 22:51:17 error in ./src/app.vue Module build failed: Module failed because of a eslint warning. ⚠ http://eslint.org/docs/rules/no-unused-vars 'o' is assigned a value but never used
src\app.vue:60:7
const o = 90;
^ ✘ 1 problem (0 errors, 1 warning) Warnings:
1 http://eslint.org/docs/rules/no-unused-vars @ ./src/main.js 12:0-28
@ 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 即可;

// 目录:/build/webpack.base.conf.js 

const createLintingRule = () => ({
test: /\.(js|vue)$/,
loader: 'eslint-loader',
enforce: 'pre',
include: [resolve('src'), resolve('test')],
options: {
formatter: require('eslint-friendly-formatter'),
emitError:false,
emitWarning: config.dev.showEslintErrorsInOverlay,
fix: true,
failOnError: true,
//如果有eslint警告,加载器将导致模块构建失败。
//设置 false 即可,去除此检验
failOnWarning: false,
}
})

但是,还是看个人喜好,若是单单在控制台提示警告也可以,不过我本人不想看到有警告,所以就硬性设为 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. web内置对象

    内置对象,宿主对象,自定义对象的区别?     内置对象:         系统所提供的对象:Object,Array,Math,Date等等.     宿主对象:         JS所运行的环境提 ...

  2. 洛谷P1046 陶陶摘苹果

    题目描述 陶陶家的院子里有一棵苹果树,每到秋天树上就会结出 101010 个苹果.苹果成熟的时候,陶陶就会跑去摘苹果.陶陶有个 303030 厘米高的板凳,当她不能直接用手摘到苹果的时候,就会踩到板凳 ...

  3. [poj 3539] Elevator (同余类bfs)

    Description Edward works as an engineer for Non-trivial Elevators: Engineering, Research and Constru ...

  4. [CodeForces]986A Fair

    大意:给一张图,每个图上有一个数,问以每个点为源点,经过的点包含k种数字的最小距离. 显然跑最短路会T,但我们注意到边权一定.某次学校考试就是类似题,可以bfs做,复杂度O(n),每种货物做一次,复杂 ...

  5. 如何利用eclipse实现批量修改文件的编码方式

        在eclipse+Eclipse环境下,打开一个jsp文件,经常发现汉字无法显示,右键点击查看这个文件属性,发现文件的字符编码属性为ISO-8859-1.    目前的解决方法有:1. 手工把 ...

  6. 洛谷——P1802 5倍经验日

    https://www.luogu.org/problem/show?pid=1802#sub 题目背景 现在乐斗有活动了!每打一个人可以获得5倍经验!absi2011却无奈的看着那一些比他等级高的好 ...

  7. spring的几个重要类和接口

    1.datasource接口是javax.sql包下的接口,不是spring,是javax.sql下的 datasource接口有个重要的方法getConnection()方法 Connection ...

  8. 支付宝接口程序、文档及解读(ASP.NET)

    最近需要为网站加入支付宝的充值接口,而目前关于支付宝接口开发的资料比较杂乱,这里就我此次开发所用到的资料进行汇总整理,希望能够帮助需要的朋友. 开发步骤: 1. 确定签约类型 支付宝的接口有多种类型, ...

  9. c#基于udp实现的p2p语音聊天工具

    原创性申明 此博文的出处 为 http://blog.csdn.net/zhujunxxxxx/article/details/40124773假设进行转载请注明出处.本文作者原创,邮箱zhujunx ...

  10. HBase读取代码

    HBase读取代码 需要的jar包: activation-1.1.jar aopalliance-1.0.jar apacheds-i18n-2.0.0-M15.jar apacheds-kerbe ...