allow negated condition in for-in guards in guard-for-in rule
See original GitHub issueI would like guard-for-in
to allow the following pattern in addition to what it currently allows.
for (key in foo) {
if (!{}.hasOwnProperty.call(foo, key)) continue;
doSomething(key);
}
To be clear, the difference is that this guard has a negated condition with a continue
as the consequent. The continue
should be allowed as the only statement in a block as well, to be compatible with that brace style preference.
for (key in foo) {
if (!{}.hasOwnProperty.call(foo, key)) {
continue;
}
doSomething(key);
}
edit:
What rule do you want to change?
guard-for-in
Does this change cause the rule to produce more or fewer warnings?
Fewer.
How will the change be implemented? (New option, new default behavior, etc.)?
New default behaviour.
Please provide some example code that this change will affect:
for (key in foo) {
if (!{}.hasOwnProperty.call(foo, key)) continue;
doSomething(key);
}
for (key in foo) {
if (!{}.hasOwnProperty.call(foo, key)) {
continue;
}
doSomething(key);
}
What does the rule currently do for this code?
Warns.
What will the rule do after it’s changed?
Not warn.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:11 (11 by maintainers)
Top Results From Across the Web
GUARD DUTY - Army Publishing Directorate
This ensures that the guards know who is authorized to challenge and inspect the guard force and to maintain security of the area...
Read more >Guard Force Management — Focus and Responsibilities
Many companies employ a third-party Guard Force Manager to oversee security operations and manage resources. There are several benefits to ...
Read more >FM3-90 Chapter 12 Security Operations - GlobalSecurity.org
A guard force uses all means at its disposal, including decisive engagement, to prevent the enemy from penetrating to a position were it...
Read more >Tag Archives: Local Guard Force - Diplopundit
We understand that the local guard force has between 900-1000 members, and that this dispute has been going on since last month.
Read more >12 FAM 420 POST SECURITY MANAGEMENT
(12) (U) Supervising the local guard force coordinator, residential security ... liaison agreements with the host government and as local conditions permit.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@platinumazure Done.
@ilyavolodin @michaelficarra Sorry for the mixup!