简体   繁体   English

JSHint supress var已在其中定义

[英]JSHint supress var is already defined inside for

On the project I am working, there are a lot of code blocks like: 在我正在工作的项目上,有很多代码块,例如:

 for (var i = 0; i < x.length; i++){ //code 1 } for (var i = 0; i < y.length; i++){ //code 2 } 

Can I disable the var is already defined warning only for this specific scenario? 我可以仅针对此特定情况禁用已定义的var警告吗?

There are files of > 10k lines, and to remove all vars and define at the top is not an option, unfortunately... 档案大于1万行,但无法移除所有var并在顶端定义,这是不幸的...

Any ideeas? 有什么想法吗?

正如@dfsq在评论中所建议的那样,似乎除了从var替换为let之外,没有其他解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM