feat(typescript-estree): support TSv4 labelled tuple members #2378
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Ref #2260
For simplicity's sake (and because babel has already released their representation), I just went with adding
TSNamedTupleMember
.I was considering doing a big breaking change an introducing a new AST node in here to represent all tuple members, instead of having all of the following as valid tuple members
TSOptionalType
,TSRestType
,TSNamedTupleMember
, and anyTypeNode
.Whilst it will be a much nicer AST to consume, it's probably too large of a change to make...
This PR also updates the versions of babel we test against, and unignores some tests. Doing so uncovered a range bug in
import type Foo from 'foo'
(theImportDefaultSpecifier
's range included thetype
keyword).Finally, I also brought over the compile-time checks added in #2375