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

commented Apr 22, 2019

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

This comment has been minimized.

Copy link
Contributor Author

commented Apr 22, 2019

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

This comment has been minimized.

Copy link
Member

commented Apr 22, 2019

Yeah, CI failure is unrelated.

@danez
danez approved these changes Apr 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.