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

255
Vistas
JSDoc/ESLint Reporting "Unresolved variable or type" in WebStorm

I'm encountering an odd issue with some ESLint reporting in a JavaScript file. I added some JSDoc definitions like the following:

/**
 * @typedef {Object} CustomRefA
 * @property {string} attr1
 * @property {string} attr2
 * @property {Boolean} attr3
 * @property {number} attr4
 */

/**
 * @typedef {Object} CustomRefB
 * @property {string} attr5
 * @property {string} attr6
 * @property {Boolean} attr7
 * @property {CustomRefA} attr8
 */

These definitions also get used for declaring return values from functions like this:

/**
 *
 * @param {Object} params
 * @param {string} params.attrA
 * @param {string} params.attrB
 * @returns {CustomRefA}
 */
function doesSomeActionA(options) {
    return { };
}

/**
 *
 * @param {Object} params
 * @param {string} params.attrA
 * @param {CustomRefA} params.attrB
 * @returns {Object}
 */
function doesSomeActionB(params) {
    return { };
}

What I can't quite figure out, though, is why when CustomRefA is referenced ESLint reports back with:

Unresolved variable or type 'CustomRefA'

This is also causing references to attributes of any objects assigned with the custom types to be reported back as unresolved, too. This doesn't seem to happen all the time, and I haven't been able find any info to indicate any differences between projects that could explain the issue.

For reference this is in WebStorm 2021.2, with what appears to be ESLint version 7.32.0 (according to Node/NPM). And I have done quite a bit of searching on this, but haven't been able to find much in the way of results that sufficiently applied to the situation.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Are you using a scratchpad? I was having this exact issue, and still can reproduce it in a sandbox, but if i move the code over to a file in the project directory the "Unresolved variable or type 'CustomRefA'" message goes away and the file doesn't report any problems.

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