1

This is ths code:

/**
 * @name Me
 * @property {String} name
 * @property {Number} minVer
 * @property {Number} maxVer
 */

/** @type {Me}  the moshe*/
var y;

Why IntelliJ says that {Me} is not defined?

Screenshot

Aminadav Glickshtein
  • 23,232
  • 12
  • 77
  • 117

2 Answers2

5

If you use @typedef instead of @name, IntelliJ will be happier:

/**
 * @typedef {Object} Me
 * @property {String} name
 * @property {Number} minVer
 * @property {Number} maxVer
 */

/** @type {Me}  the moshe*/
var y;
pintxo
  • 2,085
  • 14
  • 27
Chris
  • 9,994
  • 3
  • 29
  • 31
  • 3
    Almost there ;) You have forgotten to actually state the type in the `@typedef` line, it has to be `@typedef {Object} Me`. Otherwise, you get a warning in IntelliJ: "Unresolved variable or type Me". Still, your example gave me the decisive hint for the right solution, so thank you! – hashchange Sep 24 '16 at 15:44
0

make sure you have configured the correct javascript version:

https://www.jetbrains.com/help/idea/javascript-specific-guidelines.html#ws_js_choose_language_version_multiple_versions

FrankyHollywood
  • 1,497
  • 19
  • 18