microsoft / microsoft/TypeScript
noUnusedParameters incorrectly triggers with @interface JSDoc in JS files
Open
Nobody has claimed this yet.
Awaiting More Feedback
Suggestion
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
Bug Report
🔎 Search Terms
noUnusedParameters @interface
🕗 Version & Regression Information
Playground link with relevant code
💻 Code
/** @interface */
class FooInterface {
/** @param {string} id */
doSomething(id) {}
}
🙁 Actual behavior
Throws the following error
'id' is declared but its value is never read.
🙂 Expected behavior
There should be no error thrown, as this is the correct (and only?) way to declare interfaces with JSDoc in JavaScript files (and also with Closure Compiler)
Contributor guide
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.
Research direction
Reproduce the diagnostic in the linked TypeScript Playground with noUnusedParameters enabled and JavaScript mode selected. Trace how @interface JSDoc and the doSomething(id) parameter are handled, then confirm that the valid interface pattern no longer reports 'id' as unused and add regression coverage for the case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100