Skip to content

Conversation

@JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Sep 22, 2025

Q                       A
Fixed Issues? Fixes #17095
Patch: Bug Fix? Yes
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

In this PR we create the ParseError from the generic ParseError interface, which provides complete parse error properties.

The File -> ParseResult<File> casting is also moved to the top level parse() method.

@JLHwung JLHwung added the PR: Bug Fix 🐛 A type of pull request used for our changelog categories label Sep 22, 2025
@babel-bot
Copy link
Collaborator

babel-bot commented Sep 22, 2025

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/60024

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 22, 2025

Open in StackBlitz

commit: dfb68b6

parser.state.strict = true;
}
return parser.getExpression() as unknown as ParseResult<Expression>;
return parser.getExpression() as ParseResult<Expression>;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ParseResult<Expression> doesn't declare properties like .comments correctly, could you improve it by the way? :)

@JLHwung JLHwung force-pushed the improve-babel-parser-error-typing branch from 448e3f5 to 00d723e Compare September 25, 2025 21:13
@liuxingbaoyu liuxingbaoyu force-pushed the improve-babel-parser-error-typing branch from a8305f6 to 4c8f0b0 Compare September 25, 2025 22:12
Copy link
Member

@liuxingbaoyu liuxingbaoyu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

@JLHwung JLHwung force-pushed the improve-babel-parser-error-typing branch from 4c8f0b0 to b76b6ba Compare September 26, 2025 01:02
@JLHwung JLHwung force-pushed the improve-babel-parser-error-typing branch from a38d6f9 to fbbed6f Compare September 29, 2025 17:58
@JLHwung JLHwung force-pushed the improve-babel-parser-error-typing branch from fbbed6f to dfb68b6 Compare September 30, 2025 01:30
This was referenced Nov 27, 2025
@github-actions github-actions bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jan 3, 2026
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 3, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: Bug Fix 🐛 A type of pull request used for our changelog categories

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ParseError doesn't have pos field

4 participants