closure-compiler
closure-compiler copied to clipboard
Allow to write typedef without variable
It's quite common in the Node.js world to write Typedef with JSDoc without creating any variables, e.g.,
/**
* Parse the config and extract arguments from the `process.argv` array.
* @param {Config} config The configuration for parsing.
* @param {string} config.abc The test variable
*/
export function parse(config = {}) {
const { abc } = config
console.log(abc)
}
/**
* @typedef {Object} Config
* @prop {string} abc The test variable
*/
The Google Closure Compiler does not understand those types, and VS Code does not understand the compiler notation with variables. Could you make it so it's possible extract the types without variables please.
Created Google internal issue http://b/122837732
As far as i know there isn't a way to define a type without creating variables. I've created the internal issue as a feature request, and we might revisit this in the future.
I'd also like this. I have annotated lots of code like this for support with IntelliSense/TypeScript and this all breaks when trying to build with Closure Compiler.