Skip to content

Throw error if TypeScript class has empty implements - #9292

Merged
existentialism merged 2 commits into
masterfrom
issue9286
Jan 7, 2019
Merged

existentialism merged 2 commits into
masterfrom
issue9286

Conversation

@existentialism

@existentialism existentialism commented Jan 7, 2019 •

Copy link
Copy Markdown
Member
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

babel-bot commented Jan 7, 2019 •

Copy link
Copy Markdown
Collaborator

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

armano2 commented Jan 7, 2019 •

Copy link
Copy Markdown
Contributor

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

existentialism commented Jan 7, 2019 •

Copy link
Copy Markdown
Member Author

@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