react-docgen-typescript icon indicating copy to clipboard operation
react-docgen-typescript copied to clipboard

Sort enum types?

Open AndrewLeedham opened this issue 5 years ago • 3 comments

Union ordering in TypeScript changes between versions and has no guarantee. Usually this is fine, but since react-docgen-typescript is often used for visual display it seems more important. E.g. something like 1 | 2 | 3 | 4 | 5 | 6 could be outputted something like 1 | 6 | 2 | 3 | 4 | 5, which looks strange.

Does it seem feasible to parse and sort unions?

AndrewLeedham avatar Sep 24 '20 00:09 AndrewLeedham

There was no activity for a long time. Closing this issue as obsolete. In case it is still valid, please, open a new one.

github-actions[bot] avatar Oct 09 '21 10:10 github-actions[bot]

Closing this issue as obsolete.

github-actions[bot] avatar Oct 17 '21 10:10 github-actions[bot]

@pvasek could this be reopened please? I'm getting complaints from users about union types being oddly sorted because of this same issue and would love to see it fixed.

quantizor avatar Apr 05 '22 17:04 quantizor

There was no activity for a long time. The issue will be closed soon.

github-actions[bot] avatar Apr 06 '23 10:04 github-actions[bot]

Closing this issue as obsolete.

github-actions[bot] avatar Apr 14 '23 10:04 github-actions[bot]

Opened a pull request for this functionality here: https://github.com/styleguidist/react-docgen-typescript/pull/503

pwolfert avatar May 20 '24 17:05 pwolfert