I don't want to turn off an code inspections, but is there a way I can define what class properties could be defined, so when using methods within the class I'm not getting Unresolved variable
warning?
I would use TypeScript however I can't do that right now. Is there another way? There's many properties that can be set or not set.
I can remove this within the constructor by defining what value can contain:
Define class properties and write jsdoc like this:
class Base {
/**
* @type {boolean}
*/
disableReset;
/**
* @param {boolean} disableReset
*/
constructor(disableReset) {
this.disableReset = disableReset;
}
reset() {
if (this.disableReset) {
// do stuff
}
}
}