Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.control-flow

Control flow in finally block

Avoid return, throw, break, or continue inside finally blocks.

#Metadata

Rule ID
ts.correctness.control-flow-in-finally
Severity
medium
Confidence
0.9
Languages
javascript, typescript
Presets
recommended, strict
Stability
stable
Applies to
file
Tags
correctness, crq-cor-028, language, rules-catalog

#Why it matters

Control-flow statements in finally override try/catch completion and can hide errors or skip cleanup intent.

#Remediation

Move return, throw, break, or continue out of the finally block, or restructure the try/finally logic.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.correctness.control-flow-in-finally.rule.yaml.