当我们用 Eslint 插件检测我们代码的规范的时候,有时候会遇到 “Trailing spaces not allowed no-trailing-spaces”报错,意思是空格不允许,多了空格,错误如下:

D:\MyCodes\simulation-project\src\views\Register.vue61:6  error  Trailing spaces not allowed  no-trailing-spaces✖ 1 problem (1 error, 0 warnings)1 error and 0 warnings potentially fixable with the `--fix` option.

这不是你的代码逻辑有错,而是你的代码不符合这个 Eslint 的规范
在这里我不想通过配置,屏蔽 Eslint 的检测,因为在公司中我们还是要符合规范的,这样与我们的初衷相违背。

解决:

  • 哪个组件?Register.vue组件,去这里改错
  • 第几行?error前面的61:6代表错误位置是61行第6个位置
  • 找到这个位置把鼠标放在这一行的末尾,删除多余空格
  • 重新保存代码即可。

总结:

  • 解决这类问题主要还是找到第几行出了错,一般都是多或者少空格(space)。

【Trailing spaces not allowed no-trailing-spaces】报错相关推荐

  1. composer PHP Fatal error: Allowed memory size of 报错解决

    执行以下命令(安装多线程) php composer.phar require hirak/prestissimo 出现以下提示 PHP Fatal error: Allowed memory siz ...

  2. 【GitLab】gitlab上配置webhook后,点击测试报错:Requests to the local network are not allowed...

    gitlab上配置webhook后,点击测试报错: Requests to the local network are not allowed 操作如下: 报错: 错误原因: gitlab 10.6 ...

  3. 关于vue使用eslint规范报Trailing Spaces not Allowed错误解决办法!

    Always Getting an Error of "Trailing Spaces not Allowed" in VueJS(在Vue中总会出现"不允许尾随空格&q ...

  4. Error:Trailing spaces not allowed no-trailing-spaces

    Error:Trailing spaces not allowed no-trailing-spaces 报错如下 解决办法 这是空格多了,删除多余的空格就可以了 或者直接格式化文档 即可解决

  5. vue项目中eslint检查警告——“Trailing spaces not allowed”

    在VSCode中开发Vue项目,eslint检查警告:"Trailing spaces not allowed",这是在警告代码后面有多余的空格导致的,删除空格即可. 转载于:ht ...

  6. vue语法检查工具eslint报错小记(error Unexpected trailing comma、Extra semicolon、error ‘loadingInstance‘ is nev)

    vue语法检查工具eslint报错小记 vue项目开发中开启语法检查工具eslint,尤其是接手别人的代码继续开发时,如果不注意语法习惯,项目运行时会出现一堆warning.error,乍一看就头大, ...

  7. org.xml.sax.SAXParseException: Content is not allowed in trailing section

    2019独角兽企业重金招聘Python工程师标准>>> org.xml.sax.SAXParseException: Content is not allowed in traili ...

  8. 解决Vue项目报错:Expected indentation of 2 spaces but found 4. eslint(indent) [8, 1]的方法

    解决Vue项目报错:Expected indentation of 2 spaces but found 4. eslint(indent) [8, 1]的方法 报错如下 问题分析 明显从图中可以以看 ...

  9. SAP WM 采购订单收货后LT06报错-Allowed storage unit types not defined for storage type Z03-

    SAP WM 采购订单收货后LT06报错-Allowed storage unit types not defined for storage type Z03- 1,如下的storage type ...

最新文章

  1. 【Spring】通过动态代理改进银行转账事务控制
  2. activemq安装与配置_ActiveMQ(消息队列)从入门到了解
  3. python FOR循环
  4. vue限制只能输入数字_vue的input中,如何限制只能输入number
  5. JQuery如何与数据库交互
  6. k8s核心技术-Service概述_Service如何实现负载均衡_提供虚拟IP_以及Po的IP注册和发现---K8S_Google工作笔记0031
  7. 【转载】中国小吃(英文表达)
  8. WCF入门学习3-配置文件与部署iis
  9. 多个蓝牙缺陷可使攻击者假冒合法设备
  10. 联合循环—— 35燃气轮机发电机结构及变频启动系统
  11. 图扑软件数字孪生挖掘机实现远程操控
  12. win7计算机未连接网络,教你w7电脑本地连接受限制或无连接的七种解决方法
  13. IE首页被篡改(手动修复)
  14. 网站怎么样对接微信公众号,看以下操作
  15. 想学Docker?我教你啊~
  16. 趋势顶底指标公式 通达信趋势顶底主图选股指标 清晰的趋势顶底详解
  17. 【软件】串口助手小软件,无需安装下载即可使用
  18. UE4源码阅读_骨骼模型与动画系统_Mesh
  19. SPA 的 SEO 方案对比、最终实践
  20. ubuntu下使用chm2pdf转换chm为pdf

热门文章

  1. php验证码手册,验证码 - ThinkPHP 5.1 完全开发手册
  2. 那些曾让我一脸懵逼的python代码
  3. Windows XP 打印机端口LPT1 响应挂死 解决
  4. 涛思数据创始人陶建辉荣获“2020中国开源杰出贡献人物”奖
  5. 怎么用思维导图做会议纪要?MindNow来教你
  6. BUPT OJ143 Triangle
  7. 老男孩第十四期Python学习班之Day02
  8. 沉淀近900万+营销资产,天攻智投户外营销助力网易有道实现“品效双赢”
  9. CNAS仪器校准人员需要遵守哪些规范?
  10. c语言程序设计精髓 第14周练兵题