详解Vue取消eslint语法限制
由于vue对语法的限制过于严格,以至于在我第一次编译运行的时候一直编译失败,当然也包括一些警告: bblee-app@1.0.0 dev /Users/bianlifeng/my-project 95% emitting WARNING Compiled with 1 warnings 5:00:12 PM ✘ http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2 ✘ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4 ✘ http://eslint.org/docs/rules/space-before-function-paren Missing space before function parentheses ✘ http://eslint.org/docs/rules/indent Expected indentation of 4 spaces but found 6 ✘ http://eslint.org/docs/rules/indent Expected indentation of 6 spaces but found 8 ✘ http://eslint.org/docs/rules/indent Expected indentation of 8 spaces but found 10 ✘ http://eslint.org/docs/rules/indent Expected indentation of 8 spaces but found 10 ✘ http://eslint.org/docs/rules/indent Expected indentation of 8 spaces but found 10 ✘ http://eslint.org/docs/rules/indent Expected indentation of 8 spaces but found 10 ✘ http://eslint.org/docs/rules/indent Expected indentation of 8 spaces but found 10 ✘ http://eslint.org/docs/rules/indent Expected indentation of 8 spaces but found 10 ✘ http://eslint.org/docs/rules/indent Expected indentation of 8 spaces but found 10 ✘ http://eslint.org/docs/rules/indent Expected indentation of 8 spaces but found 10 ✘ http://eslint.org/docs/rules/indent Expected indentation of 6 spaces but found 8 ✘ http://eslint.org/docs/rules/indent Expected indentation of 4 spaces but found 6 ✘ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4 ✘ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4 ✘ http://eslint.org/docs/rules/indent Expected indentation of 4 spaces but found 6 ✘ http://eslint.org/docs/rules/space-before-function-paren Missing space before function parentheses ✘ http://eslint.org/docs/rules/indent Expected indentation of 6 spaces but found 8 ✘ http://eslint.org/docs/rules/indent Expected indentation of 4 spaces but found 6 ✘ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4 ✘ http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2 ✘ 23 problems (23 errors,0 warnings) Errors: You may use special comments to disable some warnings. 当然,这里的警告我是知道怎么回事,但是这个错误我就很不明白了,原来eslint是一个语法检查工具,但是限制很严格,在我的vue文件里面很多空格都会导致红线(红线可以关闭提示),虽然可以关闭,但是在编译的时候老是会跳出来,所以能关闭是最好的了。 关闭方法: 在build/webpack.base.conf.js文件中,注释或者删除掉:module->rules中有关eslint的规则 然后重新运行一下npm run dev或者构建命令 npm run build就可以啦。 (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |