When using @testing-library/svelte@5.2.x with Svelte 4, wrapping render can cause spurious @typescript-eslint/no-unsafe-argument errors. I suspect this is due to some sort of bug in eslint-plugin-svelte, but I have not yet produced a minimal reproduction.
import type { ComponentProps } from 'svelte';
import { render } from '@testing-library/svelte';
import Subject from '../app.svelte';
const renderSubject = (props: ComponentProps<Subject>) => {
return render(Subject, props);
};
error Unsafe argument of type `any` assigned to a parameter of type `SvelteComponentOptions<SvelteComponent<Record<string, any>, Record<string, any>, Record<string, any>>> | undefined` @typescript-eslint/no-unsafe-argument
When using
@testing-library/svelte@5.2.x
with Svelte 4, wrappingrender
can cause spurious@typescript-eslint/no-unsafe-argument
errors. I suspect this is due to some sort of bug ineslint-plugin-svelte
, but I have not yet produced a minimal reproduction.In the meantime, this PR