google / google/closure-compiler

Allow to write typedef without variable

Open
#3,192 3 comments 2 reactions 0 assignees View on GitHub
internal-issue-created triage-done
Dominant language
JavaScript
Stars
7.7k
Forks
1.2k
Avg merge
2d 12h
Merged PRs (30d)
6

Description

It's quite common in the Node.js world to write Typedef with JSDoc without creating any variables, e.g.,

```js
/**
* 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.