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

fix(scope-manager): handle typeParameters of TSInstantiationExpression #5355

Merged
merged 2 commits into from Jul 22, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -921,6 +921,17 @@ export declare namespace Foo {
}
}
}
`,
`
class Foo<T> {
armano2 marked this conversation as resolved.
Show resolved Hide resolved
value: T
}

class Bar<T> {
foo = Foo<T>
}

new Bar()
`,
{
code: `
Expand Down
7 changes: 7 additions & 0 deletions packages/scope-manager/src/referencer/Referencer.ts
Expand Up @@ -692,6 +692,13 @@ class Referencer extends Visitor {
this.close(node);
}

protected TSInstantiationExpression(
node: TSESTree.TSInstantiationExpression,
): void {
this.visitChildren(node, ['typeParameters']);
this.visitType(node.typeParameters);
armano2 marked this conversation as resolved.
Show resolved Hide resolved
}

protected TSInterfaceDeclaration(
node: TSESTree.TSInterfaceDeclaration,
): void {
Expand Down