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
Improve parse error location? #16205
Comments
Hey @fisker! We really appreciate you taking the time to report an issue. The collaborators on this project attempt to help as many people as possible, but we're a limited number of volunteers, so it's possible this won't be addressed swiftly. If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack community that typically always has someone willing to help. You can sign-up here for an invite. |
Sorry, I accidentally closed it.🤦♂️ |
The first example may not be possible because the unexpected token actually refers to EOF. |
In many places we already pass the AST node to our internal utilities that generate errors, so with some minimal changes we could experiment reading both its start and end locations and see how good it is. |
💻
What problem are you trying to solve?
For some parse errors, it's fine to point the error to a single character. But some other errors, it will be nicer to have a start/end range.
Describe the solution you'd like
Add end location to error.
Describe alternatives you've considered
N/A
Documentation, Adoption, Migration Strategy
The text was updated successfully, but these errors were encountered: