前端前端开发

启动vue时ESlint报错

2018-07-18  本文已影响1331人  虫yu
✘ 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

上一篇 下一篇

猜你喜欢

热点阅读