Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
feat: [4.7] support optional variance annotation#4831
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
bradzacher merged 12 commits intotypescript-eslint:mainfromsosukesuzuki:optional-varianceMay 19, 2022
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
12 commits Select commitHold shift + click to select a range
5d9f45f
feat(ast-spec): add `in` and `out` to `TSTypeParameter`
sosukesuzuki0a74ba8
feat(typescript-estree): add `in` and `out` to `TSTypeParameter`
sosukesuzuki0eb5560
test(typescript-estree): add tests for optional variance syntax
sosukesuzuki435f610
test(typescript-estree): update snapshots
sosukesuzuki1f0958f
fix(typescript-estree): use `hasModifier`
sosukesuzuki088d45c
test(typescript-estree): update snapshots
sosukesuzuki6cd5c7e
test(typescript-estree): fix for babel
sosukesuzuki96f0b45
fix(ast-spec): make `in` and `out` boolean
sosukesuzukib630664
Merge branch 'main' into optional-variance
bradzacher03acdb3
fix spelling typo
bradzacher42d2c74
test(ast-spec): update snapshots
sosukesuzuki68c350b
test(typescript-estree): update snapshots
sosukesuzukiFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
2 changes: 2 additions & 0 deletions...eclaration/fixtures/type-parameters-extends-type-parameters/snapshots/1-TSESTree-AST.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...ation/fixtures/type-parameters-extends-type-parameters/snapshots/5-AST-Alignment-AST.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...c/src/declaration/ClassDeclaration/fixtures/type-parameters/snapshots/1-TSESTree-AST.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions.../declaration/ClassDeclaration/fixtures/type-parameters/snapshots/5-AST-Alignment-AST.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionspackages/ast-spec/src/special/TSTypeParameter/spec.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionspackages/shared-fixtures/fixtures/typescript/types/optional-variance-in-and-out.src.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Mapper<in T, out U> = (x: T) => U; |
1 change: 1 addition & 0 deletionspackages/shared-fixtures/fixtures/typescript/types/optional-variance-in-out.src.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Processor<in out T> = (x: T) => T; |
1 change: 1 addition & 0 deletionspackages/shared-fixtures/fixtures/typescript/types/optional-variance-in.src.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Consumer<in T> = (x: T) => void; |
1 change: 1 addition & 0 deletionspackages/shared-fixtures/fixtures/typescript/types/optional-variance-out.src.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
type Provider<out T> = () => T; |
2 changes: 2 additions & 0 deletionspackages/typescript-estree/src/convert.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletionspackages/typescript-estree/tests/ast-alignment/fixtures-to-test.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletionspackages/typescript-estree/tests/ast-alignment/utils.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionspackages/typescript-estree/tests/lib/__snapshots__/convert.test.ts.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletionspackages/typescript-estree/tests/lib/__snapshots__/semantic-diagnostics-enabled.test.ts.snap
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions.../tests/snapshots/typescript/babylon-convergence/type-parameter-whitespace-loc.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...escript-estree/tests/snapshots/typescript/babylon-convergence/type-parameters.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...-estree/tests/snapshots/typescript/basics/arrow-function-with-type-parameters.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions...script-estree/tests/snapshots/typescript/basics/call-signatures-with-generics.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions.../tests/snapshots/typescript/basics/class-with-constructor-and-type-parameters.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...-estree/tests/snapshots/typescript/basics/class-with-extends-generic-multiple.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...ypescript-estree/tests/snapshots/typescript/basics/class-with-extends-generic.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...pt-estree/tests/snapshots/typescript/basics/class-with-generic-method-default.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...typescript-estree/tests/snapshots/typescript/basics/class-with-generic-method.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionspackages/typescript-estree/tests/snapshots/typescript/basics/class-with-method.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletions...ypescript-estree/tests/snapshots/typescript/basics/class-with-mixin-reference.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletionspackages/typescript-estree/tests/snapshots/typescript/basics/class-with-mixin.src.ts.shot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
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.