-
-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding a used-types
rule
#1058
Adding a used-types
rule
#1058
Conversation
.README/README.md
Outdated
@@ -203,6 +204,7 @@ Problems reported by rules which have a wrench :wrench: below can be fixed autom | |||
|:heavy_check_mark:|:wrench:|[empty-tags](./docs/rules/empty-tags.md#readme)|Checks tags that are expected to be empty (e.g., `@abstract` or `@async`), reporting if they have content| | |||
|:heavy_check_mark:||[implements-on-classes](./docs/rules/implements-on-classes.md#readme)|Prohibits use of `@implements` on non-constructor functions (to enforce the tag only being used on classes/constructors)| | |||
|||[informative-docs](./docs/rules/informative-docs.md#readme)|Reports on JSDoc texts that serve only to restart their attached name.| | |||
|||[mark-used](./docs/rules/mark-used.md#readme)|Marks all types referenced in `{@link}`d tags as used.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't all of these document comments be expressed more broadly that this is for more than just {@link}
tags?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Totally - good catch. I had the link
as my primary objective when writing that.
How about:
|||[mark-used](./docs/rules/mark-used.md#readme)|Marks all types referenced in `{@link}`d tags as used.| | |
|||[mark-used](./docs/rules/mark-used.md#readme)|Marks all types referenced from JSDoc tags as used.| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure. If you could also do so where the other docs mention it too.
.README/rules/mark-used.md
Outdated
|
||
{"gitdown": "contents", "rootId": "mark-used"} | ||
|
||
Marks all types referenced in `{@link}` tags as used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Marks all types referenced in `{@link}` tags as used. | |
Marks all types referenced from JSDoc tags as used. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One nit: change "jsdoc" to "JSDoc"
.README/rules/mark-used.md
Outdated
@@ -0,0 +1,27 @@ | |||
# `mark-used` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like some feedback on the name. It doesn't convey that this has to do with "types" being marked as used. An alternative would be used-types
as a tribute to the valid-types
rule, which already exists in the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
used-types
sounds good to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pushed a rename to "used-types".
@brettz9 oh my. I just realised that the
I'm contemplating closing this PR and extending that rule to cover inline tags instead. What do you think? |
It became a part of issue #99 (see comment to try to avoid the Re: the source of the bugginess, see the discussion up to this comment including its reference to this ESLint issue which, to my knowledge, has not yet been fixed. Btw, in #721 , there was some similar confusion, perhaps by myself as well, about |
Okay. This makes sense. I'll continue my work here then 👍 I just read the issues you referenced and I'm starting to get the big picture. |
I think we need to either add support for We wouldn't want to drop support for existing users, nor duplicate functionality across rules. I'm sorry for the ambivalence about a separate rule (and any extra work it's led to for you), but I'm just not fully sure about it either way at this point. I'm open to suggestions. |
Okay - I'll continue in this PR then 👍
But, could that be a follow-up PR? It seems like a completely different approach is needed for that to work, right? |
At this point, and as a result of our discussions, I'm leaning to changing the |
Okay - I can open another PR trying to adopt Somewhat related I'm seeing test failures in the |
Ok, and that is looking great, by the way. Quite a speed!
Yes, that may well be. |
I'll go ahead and close as I've decided to keep things in the |
This adds a
mark-used
rule which will mark types referenced by jsdoc as used.TODO
{@link ...}
via a PR to@es-joy/jsdoccomment
adding support for parsing of inline tags, as per @brettz9's suggestiion.