docs-parser
docs-parser copied to clipboard
Bullet lists incorrectly take precedence over explicit `Returns <type>`
See https://github.com/electron/electron/issues/37781 - this lead to a wildly incorrect return type of:
getPreferredSystemLanguages(): Array<'app.getLocale()' | 'app.getSystemLocale()' | 'app.getPreferredSystemLanguages()' | 'app.getLocale()' | 'app.getSystemLocale()' | 'app.getPreferredSystemLanguages()'>;
I looked into this this week and honestly this is a tricky one, the list isn't taking precedence, rather augmenting the String type.
The logic is basically "is it a string, if so is there a list, if so make an enum from that list" which is hard to be like "unless it's not an enum list" when we clearly can't detect them very well