Summary
Several components have TypeScript safety issues: any types, @ts-ignore suppressions, missing type exports, unsafe type casting, and outdated type patterns. These reduce type safety for both maintainers and consumers.
Goal
Achieve strict TypeScript compliance across all components with zero any types, zero @ts-ignore comments, and full prop type exports.
Affected Components
| Component |
Issue |
Details |
| Tooltip (#648) |
item 2 |
Unsafe index operation in getTransformForPlacement — align could be undefined |
| Toast (#647) |
items 1, 4 |
toast() uses wrong type (ToasterProps vs ToastOptions); empty interface extension |
| ThemeProvider (#646) |
item 1 |
Two @ts-ignore comments without explanation |
| Sidebar (#637) |
item 4 |
as?: ReactElement too permissive — should be React.ElementType |
| SidePanel (#636) |
item 2 |
SidePanelProps doesn't extend HTMLAttributes<HTMLAsideElement> |
| Radio (#630) |
item 3 |
RadioProps and RadioGroupProps not exported |
| List (#626) |
item 2 |
align prop declared in docs but missing from TypeScript interface |
| DataTable (#612) |
items 1, 3 |
as unknown as TData[] unsafe casting; column defs not memoized |
| Command (#609) |
item 1 |
export const Command: any — loses all type safety |
| Breadcrumb (#600) |
item 21 |
BreadcrumbProps extends HTMLDivElement but renders <nav> |
| Amount (#595) |
item 7 |
@ts-ignore on format() call |
| Accordion (#592) |
item 6 |
Deprecated ElementRef should be ComponentRef |
| Checkbox (#604) |
item 16 |
Deprecated ElementRef should be ComponentRef |
Common Patterns to Fix
1. Replace any with proper types
// Before
export const Command: any = Object.assign(...)
// After
export const Command: CommandType = Object.assign(...)
2. Remove @ts-ignore with proper type handling
// Before
// @ts-ignore
format(finalBaseValue)
// After
format(Number(finalBaseValue))
3. Export prop types for consumer use
// Add to public API
export type { RadioProps, RadioGroupProps } from './radio';
4. Migrate ElementRef → ComponentRef
// Before (deprecated)
type Ref = React.ElementRef<typeof Primitive>;
// After
type Ref = React.ComponentRef<typeof Primitive>;
Acceptance Criteria
Summary
Several components have TypeScript safety issues:
anytypes,@ts-ignoresuppressions, missing type exports, unsafe type casting, and outdated type patterns. These reduce type safety for both maintainers and consumers.Goal
Achieve strict TypeScript compliance across all components with zero
anytypes, zero@ts-ignorecomments, and full prop type exports.Affected Components
getTransformForPlacement—aligncould be undefinedtoast()uses wrong type (ToasterPropsvsToastOptions); empty interface extension@ts-ignorecomments without explanationas?: ReactElementtoo permissive — should beReact.ElementTypeSidePanelPropsdoesn't extendHTMLAttributes<HTMLAsideElement>RadioPropsandRadioGroupPropsnot exportedalignprop declared in docs but missing from TypeScript interfaceas unknown as TData[]unsafe casting; column defs not memoizedexport const Command: any— loses all type safetyBreadcrumbPropsextendsHTMLDivElementbut renders<nav>@ts-ignoreonformat()callElementRefshould beComponentRefElementRefshould beComponentRefCommon Patterns to Fix
1. Replace
anywith proper types2. Remove
@ts-ignorewith proper type handling3. Export prop types for consumer use
4. Migrate
ElementRef→ComponentRefAcceptance Criteria
anytypes in component source@ts-ignore/@ts-expect-errorcommentsElementRefmigrated toComponentRefeverywhereas unknown as)