Skip to content
This repository was archived by the owner on Jan 19, 2019. It is now read-only.

Fix: Calculate range correctly when generic class is exported (fixes #152) #155

Merged
merged 1 commit into from
Feb 10, 2017

Conversation

soda0289
Copy link
Member

@soda0289 soda0289 commented Feb 7, 2017

When a class with a generic definition is exported we must take the
type parameters into account when finding the opening brace. This
continues the fix of pull request #153 and handles the case of exporting
a class with generics. We now find the last type parameter and use the
succeeding token as the opening brace.

@eslintbot
Copy link

Thanks for the pull request, @soda0289! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary must be 72 characters or shorter. Please check out our guide for how to properly format your commit summary and update it on this pull request.

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

…nt#152)

When a class with a generic definition is exported we must take the
type parameters into account when finding the opening brace. This
continues the fix of pull request eslint#153 and handles the case of exporting
a class with generics. We now find the last type parameter and use the
succeeding token as the opening brace.
@soda0289 soda0289 force-pushed the fix-class-body-range-generics branch from 8789bb9 to 28d1344 Compare February 7, 2017 04:09
@eslintbot
Copy link

LGTM

@soda0289
Copy link
Member Author

soda0289 commented Feb 7, 2017

I missed a case earlier. I have tested this with extends and implements clauses as well. Let me know if I should add tests for theses cases. We already have tests for implements and extends but not with export.

Copy link
Member

@JamesHenry JamesHenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@JamesHenry JamesHenry merged commit e96ba1f into eslint:master Feb 10, 2017
@soda0289 soda0289 deleted the fix-class-body-range-generics branch May 23, 2017 13:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants