Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

304
Views
Define a classes possible properties

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?

enter image description here

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:

enter image description here

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

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
    }
  }
}

enter image description here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!