Vue取消eslint语法限制

r囧r小猫 2023-10-02 14:23 83阅读 0赞

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

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

  1. > bblee-app@1.0.0 dev /Users/bianlifeng/my-project
  2. > webpack-dev-server --inline --progress --config build/webpack.dev.conf.js
  3. 95% emitting
  4. WARNING Compiled with 1 warnings 5:00:12 PM
  5. http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2
  6. src/components/Message.vue:46:1
  7. export default {
  8. ^
  9. http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4
  10. src/components/Message.vue:47:1
  11. data() {
  12. ^
  13. http://eslint.org/docs/rules/indent Expected indentation of 2 spaces but found 4
  14. src/components/Message.vue:65:1
  15. }
  16. ^
  17. http://eslint.org/docs/rules/indent Expected indentation of 0 spaces but found 2
  18. src/components/Message.vue:66:1
  19. }
  20. ^
  21. 23 problems (23 errors, 0 warnings)

解决方法:

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

watermark_type_ZHJvaWRzYW5zZmFsbGJhY2s_shadow_50_text_Q1NETiBAamF2YeadjuadqOWLhw_size_20_color_FFFFFF_t_70_g_se_x_16

发表评论

表情:
评论列表 (有 0 条评论,83人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Vue取消eslint语法限制

    我的qq  2038373094 由于ESlint的语法要求太苛刻了,总是报一大堆错误;但是功能是没有影响的,所以最好关闭eslint语法限制 ![watermark