Skip to content

Commit 8847ed5

Browse files
authored
[fix] silence unused type hints in generated proxy files (#6391)
Fixes #6290 for real
1 parent 05d532b commit 8847ed5

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.changeset/grumpy-bugs-jog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
[fix] silence unused type hints in generated proxy files

packages/kit/src/core/sync/write_types/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,11 +561,11 @@ export function tweak_types(content, names) {
561561
);
562562
} else {
563563
// prevent "type X is imported but not used" (isn't silenced by @ts-nocheck) when svelte-check runs
564-
code.append(`;${type};`);
564+
code.append(`;null as any as ${type};`);
565565
}
566566
} else {
567567
// prevent "type X is imported but not used" (isn't silenced by @ts-nocheck) when svelte-check runs
568-
code.append(`;${type};`);
568+
code.append(`;null as any as ${type};`);
569569
}
570570

571571
modified = true;

packages/kit/src/core/sync/write_types/index.spec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ test('Rewrites types for a TypeScript module without param', () => {
134134
a: 1
135135
};
136136
};
137-
;Get;`
137+
;null as any as Get;`
138138
);
139139
});
140140

0 commit comments

Comments
 (0)