You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bug: [no-loop-func] using / await using declarations are falsely flagged inside loops #12496
I can reproduce this, and, yes, without having thought too hard, it seems that the using declarations probably should be treated the same as the const declarations. But what does the base rule do here? The extension rule should probably just follow the same logic.
Yeah, looks that way. I ran our full test suite against the base rule and everything passes. The only extra thing we had was the isTypeReference check, but the base rule handles those cases fine now without it.
Activity
zaewc commentedon Jul 6, 2026
I think the cause is that the extension currently only casing
consttypescript-eslint/packages/eslint-plugin/src/rules/no-loop-func.ts
Lines 144 to 148 in 0cb380f
kirkwaiblinger commentedon Jul 6, 2026
I can reproduce this, and, yes, without having thought too hard, it seems that the
usingdeclarations probably should be treated the same as theconstdeclarations. But what does the base rule do here? The extension rule should probably just follow the same logic.zaewc commentedon Jul 6, 2026
The base rule already handles this
https://github.com/eslint/eslint/blob/04174cbfaac1f9555400b5332d69056e6aab9cc6/lib/rules/no-loop-func.js#L18
bradzacher commentedon Jul 6, 2026
Can we just delete the extension rule slash mark it as deprecated? Aren't all of the changes in the extension rule also on the base rule now?
zaewc commentedon Jul 7, 2026
Yeah, looks that way. I ran our full test suite against the base rule and everything passes. The only extra thing we had was the
isTypeReferencecheck, but the base rule handles those cases fine now without it.zaewc commentedon Jul 7, 2026
Sorry, I accidentally closed this issue and I don’t have permission to reopen it 😰
kirkwaiblinger commentedon Jul 7, 2026
Deprecate, yes, but can't remove it until the minimum supported ESLint version is raised