Skip to content

fix: constructor-super false positives in branching/loop/try control flow#1244

Merged
fansenze merged 2 commits into
mainfrom
fix/constructor-super-false-positives
Jul 10, 2026
Merged

fix: constructor-super false positives in branching/loop/try control flow#1244
fansenze merged 2 commits into
mainfrom
fix/constructor-super-false-positives

Conversation

@swwind

@swwind swwind commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Summary

Fix constructor-super false positives, verified against upstream ESLint (v10.6.0).

Case Upstream ESLint rslint before fix
if/else both call super(), then other code 0 errors 1 error (false positive)
switch all cases call super(), then other code 0 errors 1 error (false positive)
while (true) { super(); break; } 0 errors 1 error (false positive)
try { super(); } finally {} 0 errors 1 error (false positive)
try { a(); } catch(e){} finally { super(); } 0 errors 1 error (false positive)
while (true) { super(); } (no break) 1 error (duplicate) 0 errors (false negative)
while (true) { super(); continue; } 1 error (duplicate) 0 errors (false negative)
do { super(); } while (true | false); 1 error (duplicate) 0 errors (false negative)
for (;;) { super(); } (no break) 1 error (duplicate) 0 errors (false negative)
try { super(); } finally { super(); } 1 error (duplicate) 0 errors (false negative)
try { super(); } finally {} super(); 1 error (duplicate) 0 errors (false negative)

Related Links

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

…flow

Trailing statements after an if/else or switch that already called
super() in every branch were incorrectly required to call super()
again, and loops/try-catch-finally weren't analyzed at all, causing
false positives on common valid patterns.
Copilot AI review requested due to automatic review settings July 9, 2026 10:41

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

A super() call inside a loop without a guaranteed break right after it
can be revisited on a later iteration, and a finally block always runs
after the try block - neither case was flagged as a duplicate.
@fansenze fansenze merged commit 105c4ac into main Jul 10, 2026
14 checks passed
@fansenze fansenze deleted the fix/constructor-super-false-positives branch July 10, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants