JSDoc @implements tag/clause not checked
See original GitHub issue// @ts-check
/**
* @typedef Foo
* @property foo {() => string}
*/
/**
* @implements {Foo}
*/
class C1 {
foo = () => {
return 10;
}
}
/**
* @implements {Foo}
*/
class C2 {
foo() {
return 10;
}
}
Expected: At least an error on C1 Actual: Neither of these error
Issue Analytics
- State:
- Created 5 years ago
- Reactions:23
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Use JSDoc: @implements
The @implements tag indicates that a symbol implements an interface. Add the @implements tag to the top-level symbol that implements the interface (for...
Read more >JSDoc Reference - TypeScript: Documentation
The list below outlines which constructs are currently supported when using JSDoc annotations to provide type information in JavaScript files.
Read more >Error TS8022 JSDoc '@extends' is not attached to a class ...
Project: MyProject;; File: JavaScript Content Files;; Line: 1; Suppression State: Active. enter image description here · javascript ...
Read more >Documenting Your JavaScript | JSDoc Crash Course - YouTube
In this video I will go over JSDoc for documenting your JavaScript code as well as using it for type checking In this...
Read more >JSDoc typings: all the benefits of TypeScript, with none of the ...
Not at all. It's trying to formalize JavaScript's informal way of implementing APIs and package interfaces. And since most JavaScript ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I attempted this with a TS
interface
but was unable to get it working. ie:EDIT: okay, so it technically does work (in that MyTest can be passed to things expecting a Test, and as long as you don’t re-declare it you will see the inherited type), but “func” doesn’t auto-inherit the documentation or type annotations. I think that’s a different issue though? maybe?
Workaround, based on this comment.