eslint的error:Strings must use singlequote等

eslint的error:Strings must use singlequote等

 WARNING  Compiled with 1 warnings                                                                                                    4:00:42 PM
  ✘  http://eslint.org/docs/rules/spaced-comment  Expected space or tab after '//' in comment  
  src/router/index.js:6:1
  //const subscribeList = r => require.ensure([], () => r(require('../components/subscribeList')), 'subscribeList');
   ^
✘ 1 problem (1 error, 0 warnings)
Errors:
  1  http://eslint.org/docs/rules/spaced-comment
You may use special comments to disable some warnings.
Use // eslint-disable-next-line to ignore the next line.
Use /* eslint-disable */ to ignore all warnings in a file.  

解决: // const

  ✘  http://eslint.org/docs/rules/no-multiple-empty-lines  More than 1 blank line not allowed              
  src/components/subscribeList.vue:6:1
<script>


</script>

解决:

<script>

</script>
  ✘  https://google.com/#q=vue%2Fvalid-template-root  The template root requires exactly one element  
  src/components/subscribeList.vue:1:1
  <template>
   ^

解决:

<template>
  <div class="main-wrap">
  </div>
</template>
  ✘  http://eslint.org/docs/rules/comma-style  Bad line breaking before and after ','  
  src/router/index.js:19:5
      ,
       ^

解决: },

  ✘  http://eslint.org/docs/rules/semi                 Extra semicolon                                                
  src/main.js:17:32
    let login = getStore('login');

解决: let login = getStore('login')

  ✘  http://eslint.org/docs/rules/no-unneeded-ternary  Unnecessary use of boolean literals in conditional expression  
  src/main.js:18:43
    store.state.login = login === 'false' ? false : true
                                             ^

解决: store.state.login = login !== "false"

  ✘  http://eslint.org/docs/rules/quotes  Strings must use singlequote  
  src/main.js:18:33
    store.state.login = login !== "false"

解决:

store.state.login = login !== 'false'
或者
/* eslint-disable */
或者
.eslintrc.js的rules里:
"quotes": [1, "single"], //引号类型 `` "" ''
error变成waring而已:
✘ 1 problem (0 errors, 1 warning)

转载于:https://my.oschina.net/u/2464371/blog/2961509

  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值