-
-
Notifications
You must be signed in to change notification settings - Fork 11
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
fix: adds support for function overloads #26
Conversation
FYI: this implementation is missing support for exported overloaded functions. I'll add that soon. // Currently working:
function foo(): any; // This node has type `TSDeclareFunction`
function foo() {}
// Missing implementation:
export function bar(): any; // This node has type `ExportNamedDeclaration` with a property `declaration` of type `TSDeclareFunction`
export function bar() {} |
That's fixed with 0d1f620. I validated this change on a large codebase. |
Thanks for all your work on this, will get to this when I can, maybe will be able to Sunday. |
Merged in f60923a |
Does this require a change to configuration? I don't see anything but I've updated to 3.3.2 and export default function useGoalTracking(wait?: string, groupId?: string): GoalMapping;
export default function useGoalTracking(wait: string, groupIds: string[]): { [groupId: string]: GoalMapping };
export default function useGoalTracking(
wait = 'goals.get',
groupId: string | string[] | undefined = undefined,
): GoalMapping | { [groupId: string]: GoalMapping } { Works as expected, except I'm currently having to insert Maybe I'm misunderstanding what this change was intended to do? But looking at the tests, I feel like the implication is that my code should work without tripping this rule. |
Ope, of course as soon as I post this – it looks like |
Sounds like another overload scenario I missed. This should not report an issue. Related: #31 |
Description (What)
This PR adds support for function overloads. Function overloads are not supported as arrow functions.
Fixes #17
Justification (Why)
Because otherwise the plugin will try to convert overloaded functions to arrow functions, breaking its intended behavior.
How Can This Be Tested?
yarn test
alwaysValid
should pass on the test