Skip to content
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

Issue with printing FunctionTypeAnnotation in interface declaration #1332

Open
moonyoulove opened this issue Jul 2, 2023 · 0 comments
Open

Comments

@moonyoulove
Copy link

https://github.com/benjamn/recast/blob/0385cd919d045d3e16ba559217efd12d1e2d4222/lib/printer.ts#L1794C32-L1794C32

Somehow, when the first code is parsed into an Abstract Syntax Tree (AST) and then printed, it transforms into the second code snippet, with an additional colon.

declare interface ClockInterface {
  setTime(d: Date): void
}
declare interface ClockInterface {
  setTime: : (d: Date) => void
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant