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

feat(typescript-estree): support TSv4 labelled tuple members #2378

Merged
merged 1 commit into from Aug 9, 2020

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented Aug 9, 2020

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 any TypeNode.
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' (the ImportDefaultSpecifier's range included the type keyword).

Finally, I also brought over the compile-time checks added in #2375

@bradzacher bradzacher added the AST PRs and Issues about the AST structure label Aug 9, 2020
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@codecov
Copy link

codecov bot commented Aug 9, 2020

Codecov Report

Merging #2378 into master will increase coverage by 0.00%.
The diff coverage is 88.23%.

@@           Coverage Diff           @@
##           master    #2378   +/-   ##
=======================================
  Coverage   93.10%   93.11%           
=======================================
  Files         285      285           
  Lines        9125     9134    +9     
  Branches     2504     2505    +1     
=======================================
+ Hits         8496     8505    +9     
  Misses        302      302           
  Partials      327      327           
Flag Coverage Δ
#unittest 93.11% <88.23%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...nt-plugin/src/rules/no-unused-vars-experimental.ts 91.48% <ø> (ø)
...pt-estree/src/ts-estree/estree-to-ts-node-types.ts 100.00% <ø> (ø)
packages/typescript-estree/src/convert.ts 98.36% <85.71%> (+0.01%) ⬆️
...ckages/scope-manager/src/referencer/TypeVisitor.ts 89.55% <100.00%> (+0.15%) ⬆️
packages/visitor-keys/src/visitor-keys.ts 100.00% <100.00%> (ø)

@bradzacher bradzacher merged commit 00d84ff into master Aug 9, 2020
@bradzacher bradzacher deleted the ts4-labelled-tuple-2 branch August 9, 2020 22:58
@longlho
Copy link

longlho commented Aug 12, 2020

This seems to be a breaking change since TS@3.x does not have NamedTupleMember

@bradzacher
Copy link
Member Author

See discussion in #2388

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 12, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
AST PRs and Issues about the AST structure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants