I have some old code that uses classic JS classes that I want to type check. For example:
/**
* @constructor
*/
function Test() {
this.x = 1;
}
However when I run tsc --noImplicitThis --noEmit --allowJs --checkJs test.js to type check it, I get the following error:
test.js:5:5 - error TS2683: 'this' implicitly has type 'any' because it does not have a type annotation.
5 this.x = 1;
~~~~
I haven't been able to find any type annotation to fix this error, either by looking at https://github.com/Microsoft/TypeScript/wiki/JsDoc-support-in-JavaScript or just by guessing. Is there a way?