启动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.
把链接打开,发现都是一些书写不规范,可以按照提示,一一改正:
也可以直接关掉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