Closed
Description
many of the typescript eslint rules don't seem to recognize svelte-specific things.
examples
events
<input
type="checkbox"
on:change={(event) => {
// error: Unsafe assignment of an `any` value. (@typescript-eslint/no-unsafe-assignment)
const foo = event.currentTarget.checked
}}
/>
here, event
is typed as Event & { currentTarget: EventTarget & HTMLInputElement }
but the typescript-eslint plugin thinks it's any
$$Generic
s
<script lang="ts">
type T = $$Generic<number>
export let foo: T
// Unsafe member access .toString on an `any` value. (@typescript-eslint/no-unsafe-member-access)
// Unsafe call of an `any` typed value. (@typescript-eslint/no-unsafe-call)
foo.toString()
</script>
here, the typescript-eslint plugin does not seem to understand $$Generic
, so it treats them as any
. (originally raised sveltejs/language-tools#1780)