Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -797,6 +797,13 @@ describe('DiagnosticsProvider', () => {
]);
});

it('falls back to any for each entry with checkJs without strict', async () => {
const { plugin, document } = setup(path.join('checkJs-no-strict', 'each-any.svelte'));
const diagnostics = await plugin.getDiagnostics(document);

assert.deepStrictEqual(diagnostics, []);
});

it('properly handles complex types for `each` blocks (diagnostics-each)', async () => {
const { plugin, document } = setup('diagnostics-each.svelte');
const diagnostics = await plugin.getDiagnostics(document);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
let anyType;
</script>

{#each anyType as anyEntry}
{anyEntry.asd()}
{/each}
2 changes: 1 addition & 1 deletion packages/svelte2tsx/svelte-shims.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ declare function __sveltets_1_awaitThen<T>(

declare function __sveltets_1_each<T extends ArrayLike<unknown>>(
array: T,
callbackfn: (value: T extends ArrayLike<infer U> ? U : never, index: number) => any
callbackfn: (value: T extends ArrayLike<infer U> ? U : any, index: number) => any
): any;

declare function __sveltets_1_createSvelte2TsxComponent<Props, Events, Slots>(
Expand Down