You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
(Real life example: extract a prop in React so you can forward the rest to the inner component)
However, if I do this with noUnusedParameters, I get an error ('a' is unused). I'd argue that in this particular scenario, it's not unused as such because it's necessary to isolate it from the rest of the parameters.
IMO the workaround makes for better code, because with --noUnusedParameters on you can assume that any identifier gets used unless intentionally marked otherwise.
You should also just be able to do function test(x: { a, b, c }, fn: (params: {b, c}) => void) { fn(x) } in the usual case due to subtyping.
Automatically closing this issue for housekeeping purposes. The issue labels indicate that it is unactionable at the moment or has already been addressed.
TypeScript Version: 2.5.2
There are some situations where you need to destructure a property from an object in order to exclude it from the rest:
Code
(Real life example: extract a prop in React so you can forward the rest to the inner component)
However, if I do this with noUnusedParameters, I get an error ('a' is unused). I'd argue that in this particular scenario, it's not unused as such because it's necessary to isolate it from the rest of the parameters.
I can do the following to workaround the problem:
But I thought I'd raise this regardless.
The text was updated successfully, but these errors were encountered: