Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.language

Array callback missing return

Array iteration callbacks with block bodies should return a value when required.

#Metadata

Rule ID
ts.correctness.array-callback-missing-return
Severity
medium
Confidence
0.88
Languages
javascript, typescript
Presets
recommended, strict
Stability
stable
Applies to
file
Tags
correctness, crq-cor-032, language, rules-catalog

#Why it matters

map, filter, reduce, every, and some expect callback return values; missing returns yield undefined elements or incorrect predicates.

#Remediation

Return the computed value from the callback, or switch to forEach when side effects are intended.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.correctness.array-callback-missing-return.rule.yaml.