no-unnecessary-generics reporting in a less useful place than it could?
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 35/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- eslint, typescript
- Domain
- tooling
Research direction
Read packages/eslint-plugin/src/rules/no-unnecessary-generics.ts around line 57, then reproduce the TypeScript example from the issue to observe the current diagnostic location. Done means the rule reports the first mention of TElement rather than the JQuery return type, with behavior covered by the relevant rule tests if present.
Written by the indexing model from the issue text.
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 https://github.com/microsoft/DefinitelyTyped-tools/blob/822dadbed4d2946f399400fd512599d0a2505d51/packages/eslint-plugin/src/rules/no-unnecessary-generics.ts#L57 it seems this is intentional.
Is this good? What do you think?
- Dominant language
- TypeScript
- Stars
- 422
- Forks
- 238
- Avg merge
- 1d 4h
- Merged PRs (30d)
- 8
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/DefinitelyTyped-tools
-
Difficulty 3/5 1-2 days Newbie friendliness 66/100
microsoft/DefinitelyTyped-tools#1324 · 8 comments ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 32/100
microsoft/DefinitelyTyped-tools#1230 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 42/100
microsoft/DefinitelyTyped-tools#1229 ·
Maintainers usually reply within 1 day
-
mergebot staleness comments do not respect tooManyOwnersPossibly taken @copilot-swe-agent claimed this 321 days ago. Open
microsoft/DefinitelyTyped-tools#1218 · 1 reaction · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
microsoft/DefinitelyTyped-tools#1211 · 1 comment ·
Maintainers usually reply within 1 day
All issues in microsoft/DefinitelyTyped-tools
Similar issues
-
perf(core): getComments() runs the approved count and the comment list as two sequential queriesOpenarea/core bot:bug bot:working
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
emdash-cms/emdash#3905 · 2 comments ·
Maintainers usually reply within 1 day
-
community first-timers-only good first issue hacktoberfest help wanted low hanging fruit up-for-grabs
Difficulty 1/5 Under an hour Newbie friendliness 90/100
lingdojo/kana-dojo#31728 · 1 comment · 5 reactions ·
Maintainers usually reply within 1 day
-
selective-claw: freshTailTurns=0 keeps ALL turns verbatim and summarizes none (slice(-0) === slice(0))Possibly taken @zjncs claimed this today. Opencomponent:tokenless
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
agentic-os-org/ANOLISA#6112 · 1 comment ·
Maintainers usually reply within 1 day
-
bug needs triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
rjsf-team/react-jsonschema-form#5439 ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day