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

async arrow function with multiple line generic #19

Closed
acutmore opened this issue Oct 31, 2024 · 0 comments
Closed

async arrow function with multiple line generic #19

acutmore opened this issue Oct 31, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@acutmore
Copy link
Collaborator

acutmore commented Oct 31, 2024

Describe the bug

@seralexeev has discovered an edge case that is not being handled correctly (#18).

The issue occurs for async arrow functions when the type parameters span multiple lines.

To Reproduce

Steps to reproduce the behavior:

const fn = async <
    T,
    U,
    V
>() => null;

Expected behavior

As the input is valid TypeScript. ts-blank-space should either mark this as an error (via on onError callback), or it should produce valid JavaScript with the same semantics.

Actual behavior

const fn = async  
      
      
     
 () => null;

And no errors.

As per the ecma262 AsyncArrowHead spec the async keyword cannot be followed by a line terminator.

Playground

https://bloomberg.github.io/ts-blank-space/play/#eyJ0c3giOmZhbHNlLCJ0ZXh0IjoiY29uc3QgZm4gPSBhc3luYyA8XG4gICAgVCxcbiAgICBVLFxuICAgIFZcbj4oKSA9PiBudWxsOyJ9

@acutmore acutmore self-assigned this Oct 31, 2024
@acutmore acutmore added the bug Something isn't working label Oct 31, 2024
acutmore added a commit that referenced this issue Oct 31, 2024
closes #19

Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
acutmore added a commit that referenced this issue Oct 31, 2024
closes #19

Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant