美文网首页前端前端开发
启动vue时ESlint报错

启动vue时ESlint报错

作者: 虫yu | 来源:发表于2018-07-18 10:07 被阅读1331次
✘ 1 problem (1 error, 0 warnings)


Errors:
  1  http://eslint.org/docs/rules/no-trailing-spaces


  ✘  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

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.

把链接打开,发现都是一些书写不规范,可以按照提示,一一改正:

image.png
也可以直接关掉ESlint提示:
bulid/webpack.base.conf.js里面有配置如下:
module: {
rules: [
...(config.dev.useEslint ? [createLintingRule()] : []),

点进config.dev.useEslint,发现在config/index.js里配置:

useEslint: true, // 改为false即可。

然后在重新执行:

cnpm run dev

成功:


image.png

参考资料:https://segmentfault.com/q/1010000007001988

相关文章

网友评论

    本文标题:启动vue时ESlint报错

    本文链接:https://www.haomeiwen.com/subject/qmanpftx.html