Skip to content
Fallow home
All docs pages

Docs home

Unused component props

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

What it reports

A Vue, Svelte, or React component prop is referenced nowhere in its own component.

Dead code explains how fallow finds it.

Why it matters

Callers pass a value that the component ignores, so a caller can think that the prop changes the output. The prop also stays in the component type and in every call site.

Example

Widget.vue declares defineProps<{ size: string }>(), or a React Widget({ size }) destructures size, but size is referenced nowhere in the component (Vue: its script or template; React: its function body or JSX).

Fix

Remove the unused prop, or reference it in the component (Vue: the script / template; React: the function body or JSX). If the prop is part of a deliberately-stable public component API, suppress the line with // fallow-ignore-next-line unused-component-prop.

Facts

FactValue
Issue typeunused-component-prop
Rule id in SARIF outputfallow/unused-component-prop
Commandfallow dead-code
Default severitywarn
Config key in rulesunused-component-props
Filter option--unused-component-props
Suppression comment// fallow-ignore-next-line unused-component-prop
Fixable with fallow fixNo
Opt-inNo