Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix: [TS4.7] allow visiting of typeParameters in TSTypeQuery (#5166)
* fix: allow visiting of typeParameters in TSTypeQuery * fix: update eslint disable to noFormat
- Loading branch information
Showing
7 changed files
with
189 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
5 changes: 5 additions & 0 deletions
5
packages/scope-manager/tests/fixtures/type-declaration/type-query-with-parameters.ts
This file contains 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,5 @@ | ||
function foo<T>(y: T) { | ||
return { y }; | ||
} | ||
|
||
export type Foo<T> = typeof foo<T>; |
167 changes: 167 additions & 0 deletions
167
packages/scope-manager/tests/fixtures/type-declaration/type-query-with-parameters.ts.shot
This file contains 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,167 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`type-declaration type-query-with-parameters 1`] = ` | ||
ScopeManager { | ||
variables: Array [ | ||
ImplicitGlobalConstTypeVariable, | ||
Variable$2 { | ||
defs: Array [ | ||
FunctionNameDefinition$1 { | ||
name: Identifier<"foo">, | ||
node: FunctionDeclaration$1, | ||
}, | ||
], | ||
name: "foo", | ||
references: Array [ | ||
Reference$3 { | ||
identifier: Identifier<"foo">, | ||
isRead: true, | ||
isTypeReference: false, | ||
isValueReference: true, | ||
isWrite: false, | ||
resolved: Variable$2, | ||
}, | ||
], | ||
isValueVariable: true, | ||
isTypeVariable: false, | ||
}, | ||
Variable$3 { | ||
defs: Array [], | ||
name: "arguments", | ||
references: Array [], | ||
isValueVariable: true, | ||
isTypeVariable: true, | ||
}, | ||
Variable$4 { | ||
defs: Array [ | ||
ParameterDefinition$2 { | ||
name: Identifier<"y">, | ||
node: FunctionDeclaration$1, | ||
}, | ||
], | ||
name: "y", | ||
references: Array [ | ||
Reference$2 { | ||
identifier: Identifier<"y">, | ||
isRead: true, | ||
isTypeReference: false, | ||
isValueReference: true, | ||
isWrite: false, | ||
resolved: Variable$4, | ||
}, | ||
], | ||
isValueVariable: true, | ||
isTypeVariable: false, | ||
}, | ||
Variable$5 { | ||
defs: Array [ | ||
TypeDefinition$3 { | ||
name: Identifier<"T">, | ||
node: TSTypeParameter$2, | ||
}, | ||
], | ||
name: "T", | ||
references: Array [ | ||
Reference$1 { | ||
identifier: Identifier<"T">, | ||
isRead: true, | ||
isTypeReference: true, | ||
isValueReference: false, | ||
isWrite: false, | ||
resolved: Variable$5, | ||
}, | ||
], | ||
isValueVariable: false, | ||
isTypeVariable: true, | ||
}, | ||
Variable$6 { | ||
defs: Array [ | ||
TypeDefinition$4 { | ||
name: Identifier<"Foo">, | ||
node: TSTypeAliasDeclaration$3, | ||
}, | ||
], | ||
name: "Foo", | ||
references: Array [], | ||
isValueVariable: false, | ||
isTypeVariable: true, | ||
}, | ||
Variable$7 { | ||
defs: Array [ | ||
TypeDefinition$5 { | ||
name: Identifier<"T">, | ||
node: TSTypeParameter$4, | ||
}, | ||
], | ||
name: "T", | ||
references: Array [ | ||
Reference$4 { | ||
identifier: Identifier<"T">, | ||
isRead: true, | ||
isTypeReference: true, | ||
isValueReference: false, | ||
isWrite: false, | ||
resolved: Variable$7, | ||
}, | ||
], | ||
isValueVariable: false, | ||
isTypeVariable: true, | ||
}, | ||
], | ||
scopes: Array [ | ||
GlobalScope$1 { | ||
block: Program$5, | ||
isStrict: false, | ||
references: Array [], | ||
set: Map { | ||
"const" => ImplicitGlobalConstTypeVariable, | ||
"foo" => Variable$2, | ||
"Foo" => Variable$6, | ||
}, | ||
type: "global", | ||
upper: null, | ||
variables: Array [ | ||
ImplicitGlobalConstTypeVariable, | ||
Variable$2, | ||
Variable$6, | ||
], | ||
}, | ||
FunctionScope$2 { | ||
block: FunctionDeclaration$1, | ||
isStrict: false, | ||
references: Array [ | ||
Reference$1, | ||
Reference$2, | ||
], | ||
set: Map { | ||
"arguments" => Variable$3, | ||
"y" => Variable$4, | ||
"T" => Variable$5, | ||
}, | ||
type: "function", | ||
upper: GlobalScope$1, | ||
variables: Array [ | ||
Variable$3, | ||
Variable$4, | ||
Variable$5, | ||
], | ||
}, | ||
TypeScope$3 { | ||
block: TSTypeAliasDeclaration$3, | ||
isStrict: true, | ||
references: Array [ | ||
Reference$3, | ||
Reference$4, | ||
], | ||
set: Map { | ||
"T" => Variable$7, | ||
}, | ||
type: "type", | ||
upper: GlobalScope$1, | ||
variables: Array [ | ||
Variable$7, | ||
], | ||
}, | ||
], | ||
} | ||
`; |
This file contains 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