mirror of
https://github.com/danbulant/oxc
synced 2026-05-19 04:08:41 +00:00
test(linter): add test case for no_unused_vars in 3b87ac4
This commit is contained in:
parent
3b87ac48ce
commit
3835189785
1 changed files with 4 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
@ -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();
|
||||
",
|
||||
|
|
@ -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;
|
||||
",
|
||||
"
|
||||
|
|
|
|||
Loading…
Reference in a new issue