Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no-constant-condition这个规则注释有误 #7

Closed
rylan0119 opened this issue Sep 10, 2017 · 1 comment
Closed

no-constant-condition这个规则注释有误 #7

rylan0119 opened this issue Sep 10, 2017 · 1 comment

Comments

@rylan0119
Copy link

“禁止将常量作为 if, for, while 里的测试条件,比如 if (true), for (;;),除非循环内部有 break 语句”这是你们给出的注释

  1. for (;;)这种形式并没有将常量作为条件,这应该不是这规则所警告的

  2. checkLoops为 false是指 允许在循环中使用常量表达式。而不是指“循环内部有 break 语句”就可以的

@xcatliu
Copy link
Member

xcatliu commented Sep 11, 2017

非常感谢指出错误!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants