启动vue时ESlint报错解决方案

开启vue项目,报了两个错
http://eslint.org/docs/rules/eol-last
http://eslint.org/docs/rules/no-trailing-spaces
看了一下,发现是代码不规范,我的是template后面尾随空行,和代码结尾少了个换行

C:\Users\xu\myProject>npm run dev

> my-project@1.0.0 dev C:\Users\xu\myProject
> webpack-dev-server --inline --progress --config build/webpack.dev.conf.js

 12% building modules 22/31 modules 9 active ...x=0!C:\Users\xu\myProject\src\App.vue{ parser: "babylon" } is deprecated; we now treat it as { parser: "bab 95% emitting

 WARNING  Compiled with 1 warnings                                                                            9:54:22 AM

  ✘  http://eslint.org/docs/rules/no-trailing-spaces  Trailing spaces not allowed
  src\components\HelloWorld.vue:6:1
   ^   
  ✘  http://eslint.org/docs/rules/eol-last            Newline required at end of file but not found
  src\components\HelloWorld.vue:16:10
  </script>
            ^
✘ 2 problems (2 errors, 0 warnings)
Errors:
  1  http://eslint.org/docs/rules/eol-last
  1  http://eslint.org/docs/rules/no-trailing-spaces

解决方案

一、安装提示修改代码规范

二、直接关掉ESlint提示
可以看到在bulid/webpack.base.conf.js里面有配置如下:
在这里插入图片描述
config/index.js里配置 useEslint: false,就可以了在这里插入图片描述

  • 2
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值