Unsupported syntax for async arrow functions with multiline generic parameters #18
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
First of all, thank you for your work on
ts-blank-space
. I've migrated all my projects to use it, and everything works great. It has been a breath of fresh air in the complex world of building TypeScript projects in monorepos.I wanted to share an edge case I encountered. I understand that this is an edge case that can be resolved by suppressing Prettier or changing a method expression to a method declaration. I don't think this case can be fixed by changing anything in
ts-blank-space
.I studied the unsupported_syntax.md and didn't find this case documented. I believe it would be helpful to add it to the documentation.
Problem Description:
Consider the following async arrow function with generic parameters:
After transformation with
ts-blank-space
, I get:Which is syntactically correct.
However, if the function contains a large list of generic parameters, Prettier may move the parameters to new lines:
After transformation with
ts-blank-space
, I get:This code is syntactically incorrect and leads to a runtime error:
Since this is not an error in
ts-blank-space
but an example of code that is not supported by design, I think it would be helpful to add it to the documentation under unsupported syntax.