欢迎访问 生活随笔!

生活随笔

当前位置: 首页 > 前端技术 > vue >内容正文

vue

Vue取消eslint语法限制

发布时间:2025/3/12 vue 38 豆豆
生活随笔 收集整理的这篇文章主要介绍了 Vue取消eslint语法限制 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

 启动vue项目的时候经常报一大堆错误、但是不影响项目运行、

这是因为vue对语法的限制过于严格造成的

> bblee-app@1.0.0 dev /Users/bianlifeng/my-project > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js95% emitting WARNING Compiled with 1 warnings 5:00:12 PM✘ http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2 src/components/Message.vue:46:1export default {^✘ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4 src/components/Message.vue:47:1data() {^✘ http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4 src/components/Message.vue:65:1}^✘ http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2 src/components/Message.vue:66:1}^✘ 23 problems (23 errors, 0 warnings)

解决方法:

在build/webpack.base.conf.js文件中,删除注释掉...(config.dev.useEslint ? [createLintingRule()] : []),这一行数据。

 

总结

以上是生活随笔为你收集整理的Vue取消eslint语法限制的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。