Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

306
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda