RFC: Specify that doc comments are allowed on simple union types
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5k
- Forks
- 162
- Avg merge
- 17h 24m
- Merged PRs (30d)
- 8
Description
Hello,
I can't find any documentation on adding tsdocs to a typescript string literal type. I was wondering if the following is possible:
type InputType =
/** the TSDoc doesn't work for num1, but I'd like it to */
| 'num1'
/** the TSDoc doesn't work for num2, but I'd also like it to */
| 'num2'
export const test = (...input: InputType[]) => {
return input
}
// I'd like to get the TSDoc from 'num1' string literal to show up
// when inputting it into the `tac` function but it does not currently show
test('num1')
I'm not 100% tied to using string literal types, so if there is another way to do this with enums, etc., I'd love to learn 😄
If the above is not currently possible, I'd love to work to add it to tsdoc (with some guidance 😄).
Thanks!
Contributor guide
No contributing guide indexed for this repository
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
Start with the TypeScript example in this issue and compare it with the existing TSDoc specification and parser behavior. Establish whether comments on simple union members are supported, then document the resolved syntax and expected editor output; seek maintainer guidance before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100