You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// xxx.js// Goal: let intellisense treat class Foo's 'this' to fake class FooTS// /** @this {FooTS} */ => currently this is invalidclassFoo{/** @this {FooTS} */constructor(){this.jsProp=123;};/** @this {FooTS} */bar(){returnthis.tsProp;}}
@this works for class methods, but it is verbose to add @this to every method.
It would be a QoL improvement to allow @this apply to JavaScript class with the effect that it apply @this to every non-static method.
This is probably invalid in original JSDoc, and doesn't make much sense.
But in vscode, it makes sense because user can use Typescript .d.ts for (more powerful and less verbose) type declaration for JavaScript implementation.
Alternatively, a more aggressive QoL could be that introduce a new tag to treat Foo type as FooTS type globally.
The text was updated successfully, but these errors were encountered:
Let a node.js JavaScript (cjs) module:
@this
works for class methods, but it is verbose to add@this
to every method.It would be a QoL improvement to allow
@this
apply to JavaScript class with the effect that it apply@this
to every non-static method.This is probably invalid in original JSDoc, and doesn't make much sense.
But in vscode, it makes sense because user can use Typescript .d.ts for (more powerful and less verbose) type declaration for JavaScript implementation.
Alternatively, a more aggressive QoL could be that introduce a new tag to treat
Foo
type asFooTS
type globally.The text was updated successfully, but these errors were encountered: