-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
import/export: false positives for typescript overloads #1357
Comments
Actually do you need all the export keywords? I’d expect the first two to not need it. |
Sorry, I should have mentioned this. Leaving them off results in a TypeScript compiler error: |
I'm encountering the same issue. |
Here's a workaround: interface Consume {
(val: number): void;
(val: string): void;
}
export const consume: Consume = (val: number | string) => {
// ...
} |
The interface workaround works for me and looks nicer than exporting all the overloads. |
The work around is good and nice that there is an alternate syntax but the plugin should be able to handle all the features of typescript |
Agreed; a PR to fix it is welcome. |
Minimal example to reproduce (not a sensible use case for overloads, but anyway):
All three
consume
will be annotated witherror Multiple exports of name 'consume' import/export
.The text was updated successfully, but these errors were encountered: