eslint 代码检查报错: error Unary operator ‘++‘ used

源代码:for循环中使用i++;
在这里插入图片描述
操作符++不能被使用。
…一脸懵逼,不都是这么写的吗??什么鬼哟~~

然后去查了一下eslint 官网 果然有鬼:https://eslint.org/docs/rules/no-plusplus

disallow the unary operators ++ and – (no-plusplus)
Because the unary ++ and – operators are subject to automatic semicolon insertion, differences in whitespace can change semantics of source code。

由于一元++和-运算符会自动插入分号,因此空格之间的差异可能会更改源代码的语义

修改为:
在这里插入图片描述
完事儿 提交代码成功~

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
引用\[1\]:这个错误是由于在使用GPU版的mxnet时,缺少了libnvidia-ml.so.1这个共享对象文件导致的。\[1\] 引用\[2\]:这个错误是在使用webpack+vue-loader时,缺少了vue-template-compiler这个依赖导致的。\[2\] 引用\[3\]:这个引用提供了一些关于在CentOS和RHEL系统上安装和配置nvidia-docker的指南,以及如何在容器中测试GPU的方法。\[3\] 关于你提到的问题,"F:\file\nextdas-web\src\utils\ip\ipv4.ts 246:13 error Unary operator '++' used no-plusplus",这是一个TypeScript的语法错误,表示在代码中使用了不允许使用的自增运算符"++",而且没有启用"no-plusplus"规则。你可以通过修改代码,避免使用自增运算符或者在tslint配置中启用"no-plusplus"规则来解决这个问题。 #### 引用[.reference_title] - *1* *3* [OSError: libnvidia-ml.so.1: cannot open shared object file: No such file or directory](https://blog.csdn.net/sinat_29957455/article/details/108489347)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [ERROR in ./src/App.vue Module Error (from ./node_modules/vue-loader/lib/index.js): [vue-loader] v...](https://blog.csdn.net/weixin_40664145/article/details/110405259)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insertT0,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值