fix(types): restore class prop on Lucide IconProps after 0.577.0 breakage
@lucide/svelte >=0.577.0 dropped `class` from IconProps — it now derives
props purely from SVGAttributes<SVGSVGElement>, which TS types without
`class`. Every <SomeIcon class="..." /> in the codebase errored (1131
errors). Augment IconProps in app.d.ts to re-add `class?: string`.
Root cause: 0.561.0 → 0.577.0 bump in commit 366c6629 (2026-03-10).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
11
src/app.d.ts
vendored
11
src/app.d.ts
vendored
@@ -23,6 +23,17 @@ declare global {
|
||||
var native_app: any;
|
||||
}
|
||||
|
||||
// @lucide/svelte ≥ 0.577.0 dropped `class` from IconProps — it now derives props purely from
|
||||
// SVGAttributes<SVGSVGElement>, which TypeScript types without `class` (uses `className` instead).
|
||||
// Every <SomeIcon class="..." /> site in the codebase errors without this augmentation.
|
||||
// If a future lucide update re-adds `class` natively, this becomes a harmless no-op.
|
||||
// Root cause: @lucide/svelte 0.561.0 → 0.577.0 bump in chore commit 366c6629 (2026-03-10).
|
||||
declare module '@lucide/svelte' {
|
||||
interface IconProps {
|
||||
class?: string;
|
||||
}
|
||||
}
|
||||
|
||||
// Stripe Buy Button web component — needed so Svelte templates accept the element without TS errors.
|
||||
declare module 'svelte/elements' {
|
||||
interface IntrinsicElements {
|
||||
|
||||
Reference in New Issue
Block a user