script-utils/linters/eslint-rules/no-unused-params-members
ESLint rule: no-unused-params-members
Flags members of a *Params / *Options parameter-bag interface that are never accessed within the function/method/constructor that receives the interface as a parameter.
Detection is per-function, using scope analysis to find the real references to the parameter (not unrelated same-named identifiers). A member counts as used when it is referenced by name — params.member, params['member'], or const { member } = params (plus a destructured signature fn({ member }: FooParams)).
Crucially, if the object ever ESCAPES whole — spread ({ ...params }), rest (const { ...rest } = params), passed as an argument (f(params)), returned, or stored (this.params = params) — every member is treated as used and nothing is reported for that interface. Such an escape either reads every member (spread/rest) or hands the object to code this rule cannot see, so member deadness cannot be decided locally.
A member is therefore flagged only when it is never referenced by name AND the object never escapes — i.e. the “a params.x usage was deleted but x was left on the interface” case. A member that is actually still needed (read via an escape) is never wrongly flagged; a member that is escaped but dead downstream is a tolerated false negative (its deadness is not local).
Only interfaces declared in the same file are checked; an imported parameter type is skipped. Only identifier-named members are tracked.
Variables
Section titled “Variables”| Variable | Description |
|---|---|
| MESSAGE_ID | Message ID reported when a *Params/*Options interface member is never accessed by the function that receives it. |
| noUnusedParamsMembers |