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

Fix(estree): Reset export's start after decorator #15107

Merged
merged 3 commits into from Nov 1, 2022

Conversation

JLHwung
Copy link
Contributor

@JLHwung JLHwung commented Oct 31, 2022

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

In this PR we partially reverts #15032 when estree plugin is enabled, so that the legacy syntax @dec export default class {} still work with the keyword-spacing rule.

@@ -1073,32 +1099,6 @@ describe("verify", () => {
});

describe("decorators #72 (legacy)", () => {
function verifyDecoratorsLegacyAndAssertMessages(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This helper is moved to the top level.

"body": [
{
"type": "ExportNamedDeclaration",
"start":5,"end":22,"loc":{"start":{"line":1,"column":5},"end":{"line":1,"column":22}},
Copy link
Contributor Author

Choose a reason for hiding this comment

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

When estree is enabled, we restore the pre-7.20 behaviour: the ExportNamedDeclaration now starts at the export token.

@babel-bot
Copy link
Collaborator

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

@nicolo-ribaudo nicolo-ribaudo merged commit cfc4532 into babel:main Nov 1, 2022
@nicolo-ribaudo nicolo-ribaudo deleted the fix-15085 branch November 1, 2022 08:15
@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 Feb 1, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 1, 2023
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: Some issue in @babel/parser version 7.20.0
4 participants