Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
support unused bindings inside typescript function type (#3060)
Browse files Browse the repository at this point in the history
  • Loading branch information
xunilrj authored Aug 16, 2022
1 parent 1431af0 commit 124af3b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ fn is_typescript_unused_ok(binding: &JsIdentifierBinding) -> Option<()> {
match parameters.syntax().parent()?.kind() {
JsSyntaxKind::TS_METHOD_SIGNATURE_CLASS_MEMBER
| JsSyntaxKind::TS_CALL_SIGNATURE_TYPE_MEMBER
| JsSyntaxKind::TS_METHOD_SIGNATURE_TYPE_MEMBER => Some(()),
| JsSyntaxKind::TS_METHOD_SIGNATURE_TYPE_MEMBER
| JsSyntaxKind::TS_FUNCTION_TYPE => Some(()),
_ => None,
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,8 @@ class C {
f(a: number);
}
console.log(new C());

function f(fn: (title: string) => boolean) {
console.log(fn);
}
f();
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ class C {
}
console.log(new C());
function f(fn: (title: string) => boolean) {
console.log(fn);
}
f();
```

# Diagnostics
Expand Down

0 comments on commit 124af3b

Please sign in to comment.