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
{{ message }}
Repository navigation
"... is declared but its value is never read" when referenced in a TSDoc linkΒ #49173
I've only skimmed through, but I didn't see anything that wouldn't align with the goals.
β Suggestion
I sometimes use TSDoc to reference another type that isn't really being used in the file I'm working in. This is often in combination with the @deprecated documentation tag. My suggestion is to stop giving the compilation error that the import is not being used. I do realize it might be some complexity that I'm not aware of here, regarding looking at the contents of the TSDocs.
π Motivating Example
importmyNotDeprecatedFunctionfrom"./other-file.ts";/** * @deprecated Use {@link myNotDeprecatedFunction} instead. */exportconstmyDeprecatedFunction=()=>{console.log("Hello world");};
As you can see, I import the other function, and this is to make sure that the link works when viewing TSDocs in VSCode (or any other IDE I'd assume). But TypeScript will complain about this import never being read. I would love to see this warning go away when I'm referencing it in a {@link}.
π» Use Cases
It simply improves my documentation without workarounds to get around the error
Activity
a-tarasyuk commentedon May 19, 2022
I think it's a duplicate of #47558. PR #47822
anton-johansson commentedon May 20, 2022
It is indeed, my bad. Thanks for the link(s)!