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

Throw error if TypeScript class has empty implements #9292

Merged
merged 2 commits into from Jan 7, 2019

Conversation

existentialism
Copy link
Member

@existentialism existentialism commented Jan 7, 2019

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

@existentialism existentialism added PR: Bug Fix 🐛 A type of pull request used for our changelog categories area: typescript labels Jan 7, 2019
nicolo-ribaudo
nicolo-ribaudo previously approved these changes Jan 7, 2019
@babel-bot
Copy link
Collaborator

babel-bot commented Jan 7, 2019

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

@nicolo-ribaudo nicolo-ribaudo dismissed their stale review January 7, 2019 15:48

Since the same function is used to parse foo<X, Y>(), maybe we should move the check to tsParseDelimitedList?

@armano2
Copy link
Contributor

armano2 commented Jan 7, 2019

i just checked and looks like error is missing also in interface heritage
this PR is going to add error for it but with wrong message.

'extends' list cannot be empty.
interface foo extends {
}

node.implements = this.tsParseHeritageClause();

node.extends = this.tsParseHeritageClause();

@existentialism
Copy link
Member Author

existentialism commented Jan 7, 2019

@armano2 Updated to handle interface/extends as well.

@nicolo-ribaudo will follow-up with another PR that improves the error message for foo<>(), it's not as straightforward to handle directly inside tsParseDelimitedList due to all of our try/catches for maybe parsing things.

@existentialism existentialism merged commit 03022d1 into master Jan 7, 2019
@existentialism existentialism deleted the issue9286 branch January 7, 2019 21:27
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 4, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: typescript 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.

Typescript: Babel doesn't throw error on empty implements in classes
5 participants