JSDoc `@property` and `@memberOf` tags
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 6.2k
- Forks
- 238
- Avg merge
- 2m
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
The TypeScript compiler supports a [subset of JSDoc](https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#unsupported-tags), not including `@property` and `@memberOf` tags. The limitation is currently tracked in https://github.com/microsoft/TypeScript/issues/7237 and a few other tickets.
I'm interested in generating `.d.ts` type definitions for JavaScript source files containing JSDoc type annotations, like this example:
```javascript
/**
* @property {number} id
*/
class Value {
constructor() {
Object.defineProperty( this, 'id', { value: _nextId ++ } );
}
}
```
Currently both TypeScript and TS Morph ignore the `@property` annotation above, meaning that part of my exported API is untyped and undocumented.
**Describe the solution you'd like**
I'd love for TypeScript or TS Morph (or both!) to be able to parse these JSDoc tags. In the case of TS Morph, I'm unsure whether it's reasonable to do full type inference based on the JSDoc, or only to parse the JSDoc tag as something typed rather than "JSDocUnknownTag".
Is this something you'd be interested in, and would PRs be welcome? Thanks!
**Describe alternatives you've considered**
N/A
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Read CONTRIBUTING.md, then review the TypeScript issue 7237 and the example JavaScript class to determine the intended scope for @property and @memberOf support. Clarify whether done means typed tag parsing in TS Morph, full type inference, or both, and identify tests covering JSDocUnknownTag behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- compilers, tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100