Skip to content
Fallow home
All docs pages

Docs home

Unused enum members

What an unused-enum-member finding of fallow dead-code means, why it matters and how to fix it.

What it reports

Enum member is never referenced.

Dead code explains how fallow finds it.

Why it matters

Readers treat each enum member as a state that can occur, so switch statements, mappings and tests keep a branch for a value that no code uses.

Example

Status.Legacy remains in an exported enum, but no code reads that member.

Fix

Remove the member after checking serialized/API compatibility, or suppress it with a reason when external data still uses it.

Facts

FactValue
Issue typeunused-enum-member
Rule id in SARIF outputfallow/unused-enum-member
Commandfallow dead-code
Default severityerror
Config key in rulesunused-enum-members
Filter option--unused-enum-members
Suppression comment// fallow-ignore-next-line unused-enum-member
Fixable with fallow fixYes
Opt-inNo