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 parsing typescript bodiless methods with the estree plugin also enabled #9890

Merged
merged 1 commit into from Apr 23, 2019

Conversation

devongovett
Copy link
Contributor

This fixes parsing of typescript bodiless methods when the estree plugin is also enabled. For context, I am adding TS support to react-docgen, which uses babel-parser with recast and therefore requires estree. reactjs/react-docgen#348

Currently, when both the typescript plugin and estree are enabled, code like the following causes a parsing error.

abstract class TSAbstractClass {
  abstract foo(name: string): boolean;
}

The problem was that the type was overridden prior to parsing, and the typescript plugin uses the type to determine whether a bodiless method is allowed. The PR fixes this issue by passing the original type through and only overriding it afterward.

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

@devongovett
Copy link
Contributor Author

I'm not sure why CI is failing. Seems to be something related to preset-env. Looks like a few other PRs are also failing.

@nicolo-ribaudo
Copy link
Member

Yeah, CI failure is unrelated.

@nicolo-ribaudo nicolo-ribaudo added area: typescript pkg: parser PR: Bug Fix 🐛 A type of pull request used for our changelog categories area: estree labels Apr 22, 2019
@existentialism existentialism merged commit 338853b into babel:master Apr 23, 2019
@devongovett devongovett deleted the estree-ts-bodiless-methods branch April 23, 2019 20:39
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: estree area: typescript outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser 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.

None yet

4 participants