Skip to content
Critiq Docs

Search docs

Search documentation pages and rules

correctness.language

Self assignment

An assignment uses the same expression on the left and right side.

#Metadata

Rule ID
ts.correctness.self-assignment
Severity
low
Confidence
0.88
Languages
javascript, typescript
Presets
recommended, strict
Stability
stable
Applies to
file
Tags
correctness, crq-cor-022, language, public-directory-parity, rules-catalog

#Why it matters

Self-assignments are almost always dead code or a typo where a different value was intended.

#Remediation

Delete the statement or fix the right-hand side so it references the intended value.

#Repository path

The generated metadata points to critiq-rules/libs/rules/catalog/rules/typescript/ts.correctness.self-assignment.rule.yaml.