-
Notifications
You must be signed in to change notification settings - Fork 233
Open
Description
Hi all!
I've been looking into this Definitely Typed pull request and picking through the issues with @JoshuaKGoldberg. We encountered an interesting case with the no-unnecessary-generics rule which we think could be better. Consider:
<TElement extends HTMLElement = HTMLElement>(
html: JQuery.htmlString,
ownerDocument_attributes?: Document | JQuery.PlainObject,
// eslint-disable-next-line @definitelytyped/no-unnecessary-generics
): JQuery<TElement>;You'll note that we have an eslint-disable-next-line just before the last line; the ReturnType of the method. Without this in place the red squigglies would be under:
JQuery<TElement>
~~~~~~~~This isn't the useful place to have this report. Perhaps the better place would be the first mention of TElement, like so:
<TElement extends HTMLElement = HTMLElement>(
~~~~~~~~Looking at
DefinitelyTyped-tools/packages/eslint-plugin/src/rules/no-unnecessary-generics.ts
Line 57 in 822dadb
| node: parserServices.tsNodeToESTreeNodeMap.get(res.soleUse), |
Is this good? What do you think?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels