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

Make error span first line only for arrow functions with expression body #60809

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

OliverJAsh
Copy link
Contributor

@OliverJAsh OliverJAsh commented Dec 18, 2024

Fixes #57866.

(In addition to #60799, this is only one part of #57866. It doesn't completely fix the issue.)

This should make the error span less noisy.

We were already doing this for block bodies, and I don't see any reason why we wouldn't also do it for non-block bodies. In my experience it's very common to have long multi-line non-block arrow functions, especially when using the pipe function.

I'm also considering whether these errors should only span => or return, but that's a bigger change.

@typescript-bot typescript-bot added the For Uncommitted Bug PR for untriaged, rejected, closed or missing bug label Dec 18, 2024
@OliverJAsh OliverJAsh marked this pull request as ready for review December 18, 2024 13:15
@typescript-bot
Copy link
Collaborator

This PR doesn't have any linked issues. Please open an issue that references this PR. From there we can discuss and prioritise.

@typescript-bot typescript-bot added For Backlog Bug PRs that fix a backlog bug and removed For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Dec 18, 2024
@OliverJAsh OliverJAsh changed the title Make error span first line only for non-block arrow functions Make error span first line only for arrow functions with expression body Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
For Backlog Bug PRs that fix a backlog bug
Projects
Status: Not started
Development

Successfully merging this pull request may close these issues.

Improve error position/range for arrow functions with expression body
2 participants