After the last update in Sveld, it became possible to give @types to props defined via a rename export, enabling us to give a type to the class prop.
Caveats:
In components where {...$$restProps} is used, an error will occur in the declaration file similar to the following:
Interface 'BadgeProps' incorrectly extends interface 'HTMLAttributes<HTMLDivElement>'.
Types of property 'class' are incompatible.
Type 'string | false | null | undefined' is not assignable to type 'string | null | undefined'.
Type 'false' is not assignable to type 'string | null | undefined'
However, this should ultimately not affect the end user. On the contrary, allowing false values is a utility for users.
Additionally, this fixes many more type errors, which brings the actionable errors of svelte-check to a minimum (there are still a couple errors that we can fix, while the rest is out of our hand).
Closes #333
After the last update in Sveld, it became possible to give
@type
s to props defined via a rename export, enabling us to give a type to theclass
prop.Caveats:
{...$$restProps}
is used, an error will occur in the declaration file similar to the following:However, this should ultimately not affect the end user. On the contrary, allowing
false
values is a utility for users.Additionally, this fixes many more type errors, which brings the actionable errors of
svelte-check
to a minimum (there are still a couple errors that we can fix, while the rest is out of our hand). Closes #333