Skip to content

Commit

Permalink
test(linter): add test case for no_unused_vars in 3b87ac4
Browse files Browse the repository at this point in the history
  • Loading branch information
Boshen committed Sep 7, 2024
1 parent 3b87ac4 commit 3835189
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ fn test_vars_simple() {
// type annotations do not get clobbered
("let x: number = 1; x = 2;", "let _x: number = 1; _x = 2;", None, FixKind::DangerousFix),
("const { a } = obj;", "", None, FixKind::DangerousSuggestion),
("let [f,\u{a0}a]=p", "let [,a]=p", None, FixKind::DangerousSuggestion),
];

Tester::new(NoUnusedVars::NAME, pass, fail)
Expand Down Expand Up @@ -469,7 +470,7 @@ fn test_functions() {
"
function foo(a: number): number;
function foo(a: number | string): number {
return Number(a)
return Number(a)
}
foo();
",
Expand Down Expand Up @@ -952,9 +953,9 @@ fn test_type_references() {
type PermissionValues<T> = {
[K in keyof T]: T[K] extends object ? PermissionValues<T[K]> : T[K];
}[keyof T];
export type ApiPermission = PermissionValues<typeof API_PERMISSIONS>;
export const API_PERMISSIONS = {} as const;
",
"
Expand Down

0 comments on commit 3835189

Please sign in to comment.