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
eslint-plugin-tsdoc: Rule to mark types referenced through {@link} and {@inheritDoc} as used #348
When writing tsdoc strings, it's powerful to be able to reference types from an inline link tag.
It would however be great if the eslint plugin would mark these as used and avoid the @typescript-eslint/no-unused-vars rule reporting types that are only referenced from tsdoc comments as unused.
As an example, the following code
classMyClass{}/** This comment reference {@link MyClass} but it's still "never used" */constfoo=null;
yields
1:7 warning 'MyClass' is defined but never used @typescript-eslint/no-unused-vars
3:7 warning 'foo' is assigned a value but never used @typescript-eslint/no-unused-vars
I'm on vacation these days too and probably won't be looking into this for the next two weeks.
PR would probably be for the typescript-eslint project, not eslint-plugin-tsdoc, right
I'm not deeply familiar with the architecture of this project, but when I did similar work for the jsdoc plugin, it was valuable to implement this as a rule as it was responsible for parsing docs comments. It also seemed to make it easier for end-users to enable / disable and configure.
I think I initially got stuck understanding where the fix actually belonged.
PR would probably be for the typescript-eslint project, not eslint-plugin-tsdoc, right
Reading this thread on the typescript-eslint project it seems they expect another plugin to be parsing these doc strings to marking symbols as used, which is why I believe I created this issue for eslint-plugin-tsdoc in the first place.
I did a POC of an implementation here: #423 and I've later realized the architecture I choose needs to be revisited. I'll need to add a dependency on @typescript-eslint/utils to retrieve and reference type information.
Activity
cowwoc commentedon Jul 19, 2023
For what it's worth, I'm also constantly tripping across this issue.
Pete Gonzalez (@octogonz) can we have your blessing for Kræn Hansen (@kraenhansen) to submit a PR?
octogonz commentedon Jul 19, 2023
Sure, sounds good to me. 🙂 I am on vacation this week but will have more time to investigate this next week.
octogonz commentedon Jul 19, 2023
Just to clarify, the PR would probably be for the
typescript-eslintproject, noteslint-plugin-tsdoc, right?kraenhansen commentedon Jul 21, 2023
I'm on vacation these days too and probably won't be looking into this for the next two weeks.
I'm not deeply familiar with the architecture of this project, but when I did similar work for the jsdoc plugin, it was valuable to implement this as a rule as it was responsible for parsing docs comments. It also seemed to make it easier for end-users to enable / disable and configure.
cowwoc commentedon Jun 15, 2024
Kræn Hansen (@kraenhansen) any progress on this issue?
kraenhansen commentedon Aug 30, 2024
Gili Tzabari (@cowwoc) some .. I spent a bit of time on this today.
I think I initially got stuck understanding where the fix actually belonged.
Reading this thread on the
typescript-eslintproject it seems they expect another plugin to be parsing these doc strings to marking symbols as used, which is why I believe I created this issue foreslint-plugin-tsdocin the first place.I did a POC of an implementation here: #423 and I've later realized the architecture I choose needs to be revisited. I'll need to add a dependency on
@typescript-eslint/utilsto retrieve and reference type information.