Given an object definition that I'm not allowed to modify:
let a = {"a-b" : 5};
How can I add JSDoc over it ?
I tried
/**
* @type {{"a-b": number}}
*/
But WebStorm tells me that this is not valid JSDoc.
Given an object definition that I'm not allowed to modify:
let a = {"a-b" : 5};
How can I add JSDoc over it ?
I tried
/**
* @type {{"a-b": number}}
*/
But WebStorm tells me that this is not valid JSDoc.
At the moment it's a topic which hasn't been resolved yet and still is in-progress.
I'd suggest to use class comments:
/**
* @typedef {Object}
* @property {number} a-b
*/
It's a valid way to document namepaths with special chanracters - see http://usejsdoc.org/about-namepaths.html, Namepaths of objects with special characters in the name. But WebStorm doesn't yet support it - see WEB-18032