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
Update babel to v7.20.0 #13733
Update babel to v7.20.0 #13733
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
} | ||
const decorators = node.declaration?.decorators ?? node.decorators; | ||
if (isNonEmptyArray(decorators)) { | ||
return Math.min(locStart(decorators[0]), start); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the old one is not right, if decorators after export
, it will still use range of decorators[0]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case is locStart(decorators[0])
less then start
? The change in Babel that broke prettier was that now the start of the outer node should always be ≤ than the start of the inner nodes, so start
≤ locStart(decorators[0])
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In which case is locStart(decorators[0]) less then start?
Other parsers, flow
/typescript
I think they followed old behavior of babel.
418df1b
to
966f2c4
Compare
@babel/parser
version
This PR only fixes
Will be done in separate prs. |
# Conflicts: # package.json # tests/unit/__snapshots__/visitor-keys.js.snap # yarn.lock
Description
Babel going to make some change to the location info babel/babel#15032. I downloaded the artifact to see what will break.
Checklist
docs/
directory).changelog_unreleased/*/XXXX.md
file followingchangelog_unreleased/TEMPLATE.md
.✨Try the playground for this PR✨