no-unused-props
Full Name in eslint-plugin-react-x
react-x/no-unused-props
Full Name in @eslint-react/eslint-plugin
@eslint-react/no-unused-props
Description
Warns about unused component prop declarations.
Unused props increase maintenance overhead and may mislead consumers of the component into thinking the prop is required or meaningful, even when it has no effect.
Examples
Failing
interface Props {
abc: string; // used
hello: string; // NOT used
}
function Component(props: Props) {
const { abc } = props; // `hello` isn't accessed from `props`
return null;
}
Passing
interface Props {
abc: string; // used
hello: string; // used
}
function Component(props: Props) {
const { abc, hello } = props;
return null;
}