Rule proposal: `no-duplicate-loops`
See original GitHub issueI’ve seen this a couple of times
Error
for (const gamma of bars.map(alpha => alpha.beta.gamma)) {
gamma('ray')
}
for (const act of actions.filter(act => typeof act === 'function')) {
act('a fool')
}
Pass
for (const alpha of bars) {
alpha.beta.gamma('ray')
}
for (const act of actions) {
if (typeof act === 'function') {
act('a fool')
}
}
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:23 (8 by maintainers)
Top Results From Across the Web
Proposed rule: Order Competition Rule - SEC.gov
proposed rule would prohibit a restricted competition trading center from internally executing certain orders of individual investors at a ...
Read more >Federal Register/Vol. 87, No. 46/Wednesday, March 9, 2022 ...
ACTION: Proposed rule. SUMMARY: The Securities and Exchange. Commission is proposing new rules under the Investment Advisers Act of.
Read more >Leveraging compatibility and diversity in ... - Springer Link
This article addresses the above limitations regarding scalability and user preference by proposing a computer-aided, diverse, user-customizable ...
Read more >mattfenwick/NMRPyStar: A Python library for parsing NMR ...
Note that hierarchical rules' first letters are capitalized, ... is a link to the NMR-STAR data dictionary; no duplicate loops, based on the...
Read more >Leveraging compatibility and diversity in computer-aided ...
Perceptual evaluations of existing rule-based. models have robustly shown that proposed mashups feature. harmonic, rhythmic, and spectral ...
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
@fisker Because you end up iterating through
bars
twice.That sounds sensible, but wouldn’t that be a completely different rule? This rule is about preventing duplicate iterations.