Files
OSIT-AE-App-Svelte/src/lucide-augment.d.ts
Scott Idem d139ed1bd0 fix(types): add aria-hidden to IconProps augment; remove orphaned ShadCN components
- lucide-augment.d.ts: add `aria-hidden?: string | boolean` to IconProps
  (SVGAttributes drops this too in @lucide/svelte ≥ 0.577.0)
- Remove src/lib/components/ui/ — ShadCN primitives with zero importers;
  bits-ui API drift was generating ~20 type errors for dead code

svelte-check: 31 errors remaining (all ModalProps.children — flowbite-svelte
API change, deferred to next session), 0 warnings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-27 19:32:24 -04:00

27 lines
1.3 KiB
TypeScript

// Module augmentation to restore `class` prop on @lucide/svelte IconProps.
//
// WHY this file exists and why it is separate from app.d.ts:
// @lucide/svelte ≥ 0.577.0 dropped `class` from IconProps (it now derives props purely from
// SVGAttributes<SVGSVGElement>, which TypeScript types without `class`). Every
// <SomeIcon class="..." /> in the codebase errors without this.
//
// WHY it cannot live in app.d.ts:
// app.d.ts is a script-context declaration file (no top-level import/export). A
// `declare module 'x' {}` in a script file is an AMBIENT MODULE DECLARATION that completely
// replaces the package's types — not an augmentation. That caused svelte-check to see
// @lucide/svelte as exporting only IconProps, making every icon import a "no exported member"
// error. Putting the declaration here with `export {}` makes this file a module, so
// `declare module` becomes a proper augmentation that merges with the package types.
//
// If a future lucide update re-adds `class` natively, this file becomes a harmless no-op.
// Root cause: @lucide/svelte 0.561.0 → 0.577.0 bump in chore commit 366c6629 (2026-03-10).
export {};
declare module '@lucide/svelte' {
interface IconProps {
class?: string;
'aria-hidden'?: string | boolean;
}
}