Skip to content

typescript strictness cleanup#770

Merged
rohanchkrabrty merged 5 commits intomainfrom
fix/typescript-strictness-cleanup
May 5, 2026
Merged

typescript strictness cleanup#770
rohanchkrabrty merged 5 commits intomainfrom
fix/typescript-strictness-cleanup

Conversation

@Shreyag02
Copy link
Copy Markdown
Contributor

@Shreyag02 Shreyag02 commented May 4, 2026

Description

Cleanup pass that strengthens type-safety across the design system and the docs site without changing runtime behavior in production code paths.

Three layers of work:

  1. Removed unsafe suppressions: 7 @ts-ignore and 6 @ts-expect-error lines either deleted (where the underlying issue was fixable) or replaced
    with proper APIs / @ts-expect-error (where the upstream type gap is real).
  2. Replaced any with precise types: ~110 any usages removed (114 → ~10) across raystack components, data-table internals, app helpers, demo
    files, and tests. New types added where needed: FilterPrimitive union, MdxJsxFlowElementLike interface, ComponentPropsType reuse.

Notable correctness improvements (latent bug fixes, not regressions):

  • theme-provider: el.style.colorScheme = null (which browsers stringified to "null") → ?? '' correctly clears the property
  • mdx-components.tsx: heading mappers now use render={} (BaseUI's actual render-prop API),
    so <h1><h6> render as the correct semantic tags. Previously rendered as <h2>/ <span> with a stray as="hN" HTML attribute.
  • examples/table/page.tsx: added ?? [] null guard so the status filter's .includes() no longer throws on undefined filter values.

Tooling cleanup:

  • Replaced the local apps/www/src/types/prettier.d.ts shim with @types/prettier@^2 as a devDependency.

Type of Change

  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (no functional changes, no bug fixes just code improvements)
  • Chore (changes to the build process or auxiliary tools and libraries such as documentation generation)

How Has This Been Tested?

  • tsc --noEmit run before and after on both packages/raystack and apps/www. Error counts unchanged from main baseline (raystack 13/13, apps/www
    56/54). The 2-error drop in apps/www comes from the mdx-components.tsx render prop fix clearing 6 @ts-expect-error suppressions.
  • biome check on all changed files. No new lint warnings introduced; remaining 4 warnings are pre-existing (React unused import in filters.tsx,
    deliberately-kept any in filter-chip.tsx).
  • Spot-checked all 24 newly-introduced as/as unknown as casts: each is either inside a runtime-narrowed branch (e.g., case FilterType.X) or in
    test code asserting deliberately-invalid input.
  • Manually traced consumers of DataTableFilterValues.value and FilterChip.value to confirm cascade casts are correct at every use site (2 cascades in filters.tsx and examples/table/page.tsx were caught and addressed).

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (.mdx files)
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Screenshots (if appropriate):

N/A — no UI changes. The mdx-components.tsx render prop fix changes the rendered HTML tag from <h2>/<span> to <h1><h6> for semantic
correctness; visual styling stays identical because it's driven by the size prop, not the tag name.

Related Issues

#675

@vercel
Copy link
Copy Markdown

vercel Bot commented May 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
apsara Ready Ready Preview, Comment May 5, 2026 8:21am

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

This pull request systematically improves TypeScript type safety across the codebase by replacing permissive any types with unknown, replacing // @ts-ignore suppressions with more specific `// `@ts-expect-error annotations, and introducing a new ComponentPropsType type alias. Changes include updates to 50+ demo files, data-table filter handling, component prop types (including a new FilterChipValue union type), test utilities, and library utilities like remark and prettier configuration handling.

Possibly related issues

  • Issue addressing TypeScript strictness improvements and any type elimination across the codebase—this PR's widespread adoption of unknown and @ts-expect-error in place of any and @ts-ignore directly aligns with and likely resolves the objectives of improving type safety and enabling stricter TypeScript checking.

Suggested reviewers

  • rsbh
  • paanSinghCoder
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'typescript strictness cleanup' clearly and concisely summarizes the main objective of the changeset: improving type safety across the codebase without runtime behavior changes.
Description check ✅ Passed The PR description is comprehensive and directly related to the changeset, detailing the three layers of work (unsafe suppressions, any replacements, public API tightening), notable correctness improvements, and testing methodology.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
packages/raystack/components/select/select-root.tsx (1)

219-220: ⚡ Quick win

Inconsistency: @ts-ignore was not converted to @ts-expect-error unlike every other suppression in this PR.

The upstream @base-ui/react issue is confirmed: autoHighlight is publicly typed as boolean only, which causes valid runtime usage of autoHighlight="always" to fail type-checking. The comment is now accurate and useful, but the directive itself should be upgraded for consistency and automatic cleanup once the upstream fix lands.

Using @ts-expect-error instead of @ts-ignore means TypeScript will emit an "Unused '@ts-expect-error' directive" warning when @base-ui/react corrects its types (tracked in their GitHub issue #4188), prompting removal of the suppression without manual tracking.

♻️ Proposed change
-          // `@ts-ignore` `@base-ui/react`@1.3.0 ComboboxRootProps types `autoHighlight` as `boolean | undefined`, but the runtime accepts `always | input-change`. Remove when upstream types are corrected.
+          // `@ts-expect-error` `@base-ui/react`@1.3.0 ComboboxRootProps types `autoHighlight` as `boolean | undefined`, but the runtime accepts `always | input-change`. Remove when upstream types are corrected.
           autoHighlight='always'
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/raystack/components/select/select-root.tsx` around lines 219 - 220,
Replace the TypeScript suppression above the autoHighlight prop in
select-root.tsx: change the existing "@ts-ignore" directive to
"@ts-expect-error" for the ComboboxRootProps/autoHighlight usage
(autoHighlight='always') so the suppression will produce an unused-directive
warning once `@base-ui/react` fixes its types; keep the existing explanatory
comment referencing ComboboxRootProps and the upstream issue.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@packages/raystack/components/select/select-root.tsx`:
- Around line 219-220: Replace the TypeScript suppression above the
autoHighlight prop in select-root.tsx: change the existing "@ts-ignore"
directive to "@ts-expect-error" for the ComboboxRootProps/autoHighlight usage
(autoHighlight='always') so the suppression will produce an unused-directive
warning once `@base-ui/react` fixes its types; keep the existing explanatory
comment referencing ComboboxRootProps and the upstream issue.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: df123a7d-cf07-4411-9e96-3f95c10a90cf

📥 Commits

Reviewing files that changed from the base of the PR and between 3017349 and 76494a6.

📒 Files selected for processing (7)
  • apps/www/src/components/mdx/mdx-components.tsx
  • apps/www/src/lib/prettier.ts
  • apps/www/src/types/prettier.d.ts
  • packages/raystack/components/amount/__tests__/amount.test.tsx
  • packages/raystack/components/amount/amount.tsx
  • packages/raystack/components/select/select-root.tsx
  • packages/raystack/components/theme-provider/theme.tsx
💤 Files with no reviewable changes (1)
  • apps/www/src/lib/prettier.ts

Comment thread apps/www/src/components/mdx/mdx-components.tsx Outdated
Comment thread apps/www/src/types/prettier.d.ts Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
apps/www/src/content/docs/components/checkbox/demo.ts (1)

6-10: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Avoid mutating the incoming props object in getCode.

getCode currently mutates props.checked, which can leak side effects back to caller state and make playground behavior non-deterministic. Normalize into a local object instead.

Suggested fix
 export const getCode = (props: ComponentPropsType) => {
-  if (props.checked === 'false') props.checked = false;
-  else if (props.checked === 'true') props.checked = true;
-
-  return `<Checkbox${getPropsString(props)}/>`;
+  const normalizedProps = {
+    ...props,
+    checked:
+      props.checked === 'false'
+        ? false
+        : props.checked === 'true'
+          ? true
+          : props.checked
+  };
+
+  return `<Checkbox${getPropsString(normalizedProps)}/>`;
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/www/src/content/docs/components/checkbox/demo.ts` around lines 6 - 10,
getCode is mutating the incoming props by reassigning props.checked; instead
create a local copy (e.g., const localProps = { ...props }) and normalize
localProps.checked from string to boolean, then pass localProps into
getPropsString; this preserves the original props object and prevents side
effects from getCode while keeping the same output logic.
apps/www/src/app/examples/table/page.tsx (1)

108-108: ⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Remove debug console.log before merging.

🧹 Proposed fix
-  console.log('tableQuery>> ', tableQuery);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/www/src/app/examples/table/page.tsx` at line 108, Remove the debug
console.log in apps/www/src/app/examples/table/page.tsx that prints
"tableQuery>> " and tableQuery; specifically delete the console.log statement
that references tableQuery (used for debugging) so no debug output remains in
the production page component or module.
🧹 Nitpick comments (7)
apps/www/src/content/docs/components/slider/props.ts (1)

42-42: 💤 Low value

eventDetails: unknown loses documentation accuracy.

The Base UI Slider's onValueChange event details parameter has a concrete type (e.g. Slider.Root.ChangeEventDetails). Using unknown here means users reading the generated docs table won't know the shape of eventDetails. Consider importing and using the concrete type, or at least adding a @remarks JSDoc with the expected shape.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/www/src/content/docs/components/slider/props.ts` at line 42, The
onValueChange prop currently types its second parameter as unknown which hides
the real event shape from docs; update the onValueChange signature in props.ts
to use the concrete event-details type from the slider library (e.g. import and
use Slider.Root.ChangeEventDetails or the exact exported ChangeEventDetails
type) so generated docs show the true shape, or if importing isn’t possible, add
a JSDoc `@remarks` on onValueChange describing the expected event-details shape
(reference the onValueChange declaration in props.ts to locate the change).
packages/raystack/components/data-table/data-table.types.tsx (1)

23-29: ⚖️ Poor tradeoff

value: unknown is the right direction, but the sibling fields create an awkward API.

DataTableFilterValues now has both value: unknown and three typed optional fields (boolValue?, stringValue?, numberValue?) with a comment saying only one should be present at a time. If value is the generic holder and the typed fields are the narrowed alternatives, consider whether value is still needed, or whether the string | boolean | number | unknown union should be expressed more explicitly. The current shape allows value to silently hold anything that the sibling typed fields can't express.

This is a broader API design concern — not a blocker for this PR — but worth tracking as a follow-up.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/raystack/components/data-table/data-table.types.tsx` around lines 23
- 29, The DataTableFilterValues type mixes a generic value: unknown with sibling
typed option fields (boolValue, stringValue, numberValue) which allows
inconsistent states; update the type to be a clear discriminated union or remove
the generic value field so only one typed variant can exist—e.g., replace
DataTableFilterValues with a union of { type: 'boolean', value: boolean } | {
type: 'string', value: string } | { type: 'number', value: number } (or make
value: string | boolean | number explicitly) so consumers cannot populate value
with something outside the typed alternatives and only one variant is allowed at
a time.
apps/www/src/content/docs/components/popover/props.ts (1)

44-46: 💤 Low value

(props: unknown, state: unknown) is less accurate than the Base UI concrete types.

The Base UI Popup render callback signature is (props: HTMLProps, state: Popup.State) => ReactElement. Using unknown makes this documentation interface less informative than the actual API — readers looking at the generated props table won't know what shape props or state have. Consider using the concrete Base UI types, or at a minimum documenting the actual shapes in a JSDoc remark.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/www/src/content/docs/components/popover/props.ts` around lines 44 - 46,
The render? prop is typed too loosely with (props: unknown, state: unknown);
update it to use the Base UI concrete types so consumers see the real API shape
— replace the unknowns with the correct Base Web types (e.g., HTMLProps for
props and Popup.State for state) on the render signature in props.ts (and add
the corresponding import or a JSDoc reference to the Base UI Popup types if
imports are not desired) so the generated docs show accurate shapes.
packages/raystack/components/command/command-root.tsx (1)

34-44: ⚡ Quick win

Make CommandRootProps generic to preserve typed callback inference.

With AutocompletePrimitive.Root.Props<unknown>, all inherited item-typed callbacks (e.g. filter, itemToStringValue, getItemLabel) will expect (item: unknown) => .... Under TypeScript's strict function type rules (contravariance), passing a callback with a narrower type—such as filter={(item: MyItem) => item.name.includes(query)}—will produce a type error, because (MyItem) => boolean is not assignable to (unknown) => boolean.

A generic T on CommandRootProps preserves the inference chain and allows callers to pass properly typed callbacks:

♻️ Proposed fix
-export interface CommandRootProps
-  extends Omit<AutocompletePrimitive.Root.Props<unknown>, 'items'> {
+export interface CommandRootProps<T = unknown>
+  extends Omit<AutocompletePrimitive.Root.Props<T>, 'items'> {
   /**
    * Items to be displayed and filtered by Base UI internally.
    * ...
    */
-  items?: readonly unknown[];
+  items?: readonly T[];
   /** Additional CSS class for the panel wrapper. */
   className?: string;
 }

Then update CommandRoot to CommandRoot<T = unknown>({ ... }: CommandRootProps<T>). Callers passing items={myTypedArray} will have T inferred automatically.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/raystack/components/command/command-root.tsx` around lines 34 - 44,
Make CommandRootProps generic so typed callbacks keep inference: change
CommandRootProps to accept a type parameter T (e.g., CommandRootProps<T =
unknown>) and extend Omit<AutocompletePrimitive.Root.Props<T>, 'items'>, then
update the CommandRoot component signature to CommandRoot<T = unknown>({ ... }:
CommandRootProps<T>) so passing items={myTypedArray} infers T and preserves the
correct types for callbacks like filter, itemToStringValue, and getItemLabel.
apps/www/src/content/docs/components/tooltip/demo.ts (1)

6-16: 💤 Low value

unknown values interpolated directly into template literals may trigger restrict-template-expressions.

After the anyComponentPropsType switch, children and trackCursorAxis destructured from Record<string, unknown> are typed as unknown. TypeScript itself won't error, but @typescript-eslint/restrict-template-expressions (enabled in recommended-type-checked) will flag ${children} and ${trackCursorAxis} as invalid interpolation targets.

♻️ Proposed fix – narrow via `String()`
 export const getCode = (props: ComponentPropsType) => {
-  const { children = 'Tooltip message', trackCursorAxis, ...rest } = props;
+  const { children = 'Tooltip message', trackCursorAxis, ...rest } = props;
+  const childrenStr = String(children);
+  const axisStr = typeof trackCursorAxis === 'string' ? trackCursorAxis : '';
   return `
     <Tooltip ${trackCursorAxis ? `trackCursorAxis="${axisStr}"` : ''}>
       <Tooltip.Trigger render={<Button />}>
         Hover me
       </Tooltip.Trigger>
       <Tooltip.Content ${getPropsString(rest)}>
-        ${children}
+        ${childrenStr}
       </Tooltip.Content>
     </Tooltip>`;
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/www/src/content/docs/components/tooltip/demo.ts` around lines 6 - 16,
The template interpolates values typed as unknown (destructured from
ComponentPropsType) causing restrict-template-expressions errors; update getCode
to coerce those values before interpolation—use String(children) for the content
interpolation and String(trackCursorAxis) (or conditionally include the
attribute only when defined) for the Tooltip attribute, and keep using
getPropsString(rest) unchanged so TypeScript-eslint no longer flags ${children}
and ${trackCursorAxis}.
apps/www/src/content/docs/components/link/demo.ts (1)

6-9: 💤 Low value

Same unknown-in-template-literal concern introduced by switching from any.

children destructured from Record<string, unknown> is typed unknown. Using it in ${children} can trigger @typescript-eslint/restrict-template-expressions if enabled. A simple String(children) cast resolves it.

♻️ Proposed fix
 export const getCode = (props: ComponentPropsType) => {
   const { children, ...rest } = props;
-  return `<Link${getPropsString(rest)}>${children}</Link>`;
+  return `<Link${getPropsString(rest)}>${String(children)}</Link>`;
 };
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@apps/www/src/content/docs/components/link/demo.ts` around lines 6 - 9, In
getCode, children is coming from ComponentPropsType as unknown so interpolating
`${children}` may violate restrict-template-expressions; convert it to a string
before embedding (e.g. use String(children)) when building the template literal
returned by getCode so the call to getPropsString(rest) remains unchanged and
the template interpolation is safe.
packages/raystack/components/data-table/utils/__tests__/index.test.tsx (1)

425-426: 💤 Low value

never[] cast is technically valid but unknown[] is more idiomatic for null/undefined boundary tests.

never[] is the bottom array type (no values can exist), which is more confusing than necessary for this use case.

♻️ Proposed change
-      expect(groupData(null as unknown as never[])).toEqual([]);
-      expect(groupData(undefined as unknown as never[])).toEqual([]);
+      expect(groupData(null as unknown as unknown[])).toEqual([]);
+      expect(groupData(undefined as unknown as unknown[])).toEqual([]);
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@packages/raystack/components/data-table/utils/__tests__/index.test.tsx`
around lines 425 - 426, The test uses the bottom type never[] when passing
null/undefined to groupData which is confusing; update the two expectations to
cast null and undefined to unknown[] instead (i.e., replace null as unknown as
never[] and undefined as unknown as never[] with null as unknown as unknown[]
and undefined as unknown as unknown[] or simply null as unknown[] / undefined as
unknown[]), keeping the calls to groupData(...) and expected [] unchanged so the
test still verifies the null/undefined boundary for the groupData function.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@apps/www/src/app/examples/table/page.tsx`:
- Around line 126-128: The current shouldShow expression calls .includes on
tableQuery?.filters?.[filters.indexOf('status')]?.value cast to string[] which
can be undefined at runtime; change the shouldShow calculation in page.tsx to
guard the status filter value by falling back to an empty array before calling
includes (e.g., derive a safeStatusArray from
tableQuery?.filters?.[filters.indexOf('status')]?.value and default to []), then
call includes(item.status) on that safe array so .includes is never invoked on
undefined; keep references to shouldShow, tableQuery, filters and item.status
when locating the code to update.

In `@apps/www/src/content/docs/components/amount/demo.ts`:
- Around line 6-8: The getCode function contains a leftover debug side-effect:
remove the console.log('props:', props) call from getCode so it no longer logs
props during normal docs rendering; keep the return that uses
getPropsString(props) unchanged.

In `@apps/www/src/content/docs/components/tabs/props.ts`:
- Line 9: Change the onValueChange callback signature from accepting unknown to
accepting string (or any) so consumers with explicit parameter types can pass
(v: string) handlers without TS errors; update the onValueChange?: (value:
unknown) => void declaration in props.ts (the Tabs props interface used by
Tabs.Root/Tabs components) to onValueChange?: (value: string) => void (or any)
to match runtime behavior and satisfy strictFunctionTypes.

In `@packages/raystack/components/data-table/components/filters.tsx`:
- Around line 140-141: Update FilterChip's value prop type to accept the actual
union used by filters (use the existing FilterPrimitive from
filter-operations.tsx or string | string[] | Date) instead of a plain string,
remove the "as string" cast at the call site (the value={filter.value as string}
usage in components/filters.tsx), and import/align the prop type with
FilterPrimitive so all callers pass filter.value directly without type
assertions; also update any FilterChip internals that assume value is always a
string to branch on string | string[] | Date as needed.

---

Outside diff comments:
In `@apps/www/src/app/examples/table/page.tsx`:
- Line 108: Remove the debug console.log in
apps/www/src/app/examples/table/page.tsx that prints "tableQuery>> " and
tableQuery; specifically delete the console.log statement that references
tableQuery (used for debugging) so no debug output remains in the production
page component or module.

In `@apps/www/src/content/docs/components/checkbox/demo.ts`:
- Around line 6-10: getCode is mutating the incoming props by reassigning
props.checked; instead create a local copy (e.g., const localProps = { ...props
}) and normalize localProps.checked from string to boolean, then pass localProps
into getPropsString; this preserves the original props object and prevents side
effects from getCode while keeping the same output logic.

---

Nitpick comments:
In `@apps/www/src/content/docs/components/link/demo.ts`:
- Around line 6-9: In getCode, children is coming from ComponentPropsType as
unknown so interpolating `${children}` may violate
restrict-template-expressions; convert it to a string before embedding (e.g. use
String(children)) when building the template literal returned by getCode so the
call to getPropsString(rest) remains unchanged and the template interpolation is
safe.

In `@apps/www/src/content/docs/components/popover/props.ts`:
- Around line 44-46: The render? prop is typed too loosely with (props: unknown,
state: unknown); update it to use the Base UI concrete types so consumers see
the real API shape — replace the unknowns with the correct Base Web types (e.g.,
HTMLProps for props and Popup.State for state) on the render signature in
props.ts (and add the corresponding import or a JSDoc reference to the Base UI
Popup types if imports are not desired) so the generated docs show accurate
shapes.

In `@apps/www/src/content/docs/components/slider/props.ts`:
- Line 42: The onValueChange prop currently types its second parameter as
unknown which hides the real event shape from docs; update the onValueChange
signature in props.ts to use the concrete event-details type from the slider
library (e.g. import and use Slider.Root.ChangeEventDetails or the exact
exported ChangeEventDetails type) so generated docs show the true shape, or if
importing isn’t possible, add a JSDoc `@remarks` on onValueChange describing the
expected event-details shape (reference the onValueChange declaration in
props.ts to locate the change).

In `@apps/www/src/content/docs/components/tooltip/demo.ts`:
- Around line 6-16: The template interpolates values typed as unknown
(destructured from ComponentPropsType) causing restrict-template-expressions
errors; update getCode to coerce those values before interpolation—use
String(children) for the content interpolation and String(trackCursorAxis) (or
conditionally include the attribute only when defined) for the Tooltip
attribute, and keep using getPropsString(rest) unchanged so TypeScript-eslint no
longer flags ${children} and ${trackCursorAxis}.

In `@packages/raystack/components/command/command-root.tsx`:
- Around line 34-44: Make CommandRootProps generic so typed callbacks keep
inference: change CommandRootProps to accept a type parameter T (e.g.,
CommandRootProps<T = unknown>) and extend
Omit<AutocompletePrimitive.Root.Props<T>, 'items'>, then update the CommandRoot
component signature to CommandRoot<T = unknown>({ ... }: CommandRootProps<T>) so
passing items={myTypedArray} infers T and preserves the correct types for
callbacks like filter, itemToStringValue, and getItemLabel.

In `@packages/raystack/components/data-table/data-table.types.tsx`:
- Around line 23-29: The DataTableFilterValues type mixes a generic value:
unknown with sibling typed option fields (boolValue, stringValue, numberValue)
which allows inconsistent states; update the type to be a clear discriminated
union or remove the generic value field so only one typed variant can
exist—e.g., replace DataTableFilterValues with a union of { type: 'boolean',
value: boolean } | { type: 'string', value: string } | { type: 'number', value:
number } (or make value: string | boolean | number explicitly) so consumers
cannot populate value with something outside the typed alternatives and only one
variant is allowed at a time.

In `@packages/raystack/components/data-table/utils/__tests__/index.test.tsx`:
- Around line 425-426: The test uses the bottom type never[] when passing
null/undefined to groupData which is confusing; update the two expectations to
cast null and undefined to unknown[] instead (i.e., replace null as unknown as
never[] and undefined as unknown as never[] with null as unknown as unknown[]
and undefined as unknown as unknown[] or simply null as unknown[] / undefined as
unknown[]), keeping the calls to groupData(...) and expected [] unchanged so the
test still verifies the null/undefined boundary for the groupData function.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: cb1770dd-cb92-4f3b-b627-722b9795bde1

📥 Commits

Reviewing files that changed from the base of the PR and between 76494a6 and 3f587c5.

📒 Files selected for processing (72)
  • apps/www/src/app/examples/table/page.tsx
  • apps/www/src/components/demo/types.ts
  • apps/www/src/components/icon-details/icon-details.tsx
  • apps/www/src/content/docs/components/accordion/demo.ts
  • apps/www/src/content/docs/components/amount/demo.ts
  • apps/www/src/content/docs/components/announcement-bar/demo.ts
  • apps/www/src/content/docs/components/avatar/demo.ts
  • apps/www/src/content/docs/components/badge/demo.ts
  • apps/www/src/content/docs/components/breadcrumb/demo.ts
  • apps/www/src/content/docs/components/button/demo.ts
  • apps/www/src/content/docs/components/callout/demo.ts
  • apps/www/src/content/docs/components/checkbox/demo.ts
  • apps/www/src/content/docs/components/chip/demo.ts
  • apps/www/src/content/docs/components/code-block/demo.ts
  • apps/www/src/content/docs/components/combobox/demo.ts
  • apps/www/src/content/docs/components/container/demo.ts
  • apps/www/src/content/docs/components/context-menu/demo.ts
  • apps/www/src/content/docs/components/copy-button/demo.ts
  • apps/www/src/content/docs/components/datatable/props.ts
  • apps/www/src/content/docs/components/drawer/demo.ts
  • apps/www/src/content/docs/components/empty-state/demo.ts
  • apps/www/src/content/docs/components/field/demo.ts
  • apps/www/src/content/docs/components/filter-chip/demo.ts
  • apps/www/src/content/docs/components/flex/demo.ts
  • apps/www/src/content/docs/components/form/props.ts
  • apps/www/src/content/docs/components/grid/demo.ts
  • apps/www/src/content/docs/components/headline/demo.ts
  • apps/www/src/content/docs/components/icon-button/demo.ts
  • apps/www/src/content/docs/components/image/demo.ts
  • apps/www/src/content/docs/components/indicator/demo.ts
  • apps/www/src/content/docs/components/input/demo.ts
  • apps/www/src/content/docs/components/label/demo.ts
  • apps/www/src/content/docs/components/link/demo.ts
  • apps/www/src/content/docs/components/menu/demo.ts
  • apps/www/src/content/docs/components/meter/demo.ts
  • apps/www/src/content/docs/components/number-field/demo.ts
  • apps/www/src/content/docs/components/popover/demo.ts
  • apps/www/src/content/docs/components/popover/props.ts
  • apps/www/src/content/docs/components/preview-card/demo.ts
  • apps/www/src/content/docs/components/progress/demo.ts
  • apps/www/src/content/docs/components/radio/demo.ts
  • apps/www/src/content/docs/components/radio/props.ts
  • apps/www/src/content/docs/components/scroll-area/demo.ts
  • apps/www/src/content/docs/components/search/demo.ts
  • apps/www/src/content/docs/components/select/demo.ts
  • apps/www/src/content/docs/components/select/props.ts
  • apps/www/src/content/docs/components/separator/demo.ts
  • apps/www/src/content/docs/components/skeleton/demo.ts
  • apps/www/src/content/docs/components/slider/demo.ts
  • apps/www/src/content/docs/components/slider/props.ts
  • apps/www/src/content/docs/components/spinner/demo.ts
  • apps/www/src/content/docs/components/switch/demo.ts
  • apps/www/src/content/docs/components/tabs/props.ts
  • apps/www/src/content/docs/components/text/demo.ts
  • apps/www/src/content/docs/components/textarea/demo.ts
  • apps/www/src/content/docs/components/toggle/demo.ts
  • apps/www/src/content/docs/components/tooltip/demo.ts
  • apps/www/src/lib/remark.ts
  • apps/www/src/lib/utils.ts
  • packages/raystack/CHANGELOG.md
  • packages/raystack/components/alert-dialog/__tests__/alert-dialog.test.tsx
  • packages/raystack/components/avatar/__tests__/avatar.test.tsx
  • packages/raystack/components/command/command-root.tsx
  • packages/raystack/components/data-table/components/filters.tsx
  • packages/raystack/components/data-table/data-table.types.tsx
  • packages/raystack/components/data-table/hooks/useFilters.tsx
  • packages/raystack/components/data-table/utils/__tests__/filter-operations.test.tsx
  • packages/raystack/components/data-table/utils/__tests__/index.test.tsx
  • packages/raystack/components/data-table/utils/filter-operations.tsx
  • packages/raystack/components/data-table/utils/index.tsx
  • packages/raystack/components/dialog/__tests__/dialog.test.tsx
  • packages/raystack/hooks/useDebouncedState.tsx
✅ Files skipped from review due to trivial changes (16)
  • packages/raystack/components/alert-dialog/tests/alert-dialog.test.tsx
  • packages/raystack/components/data-table/utils/tests/filter-operations.test.tsx
  • apps/www/src/content/docs/components/switch/demo.ts
  • apps/www/src/content/docs/components/announcement-bar/demo.ts
  • apps/www/src/content/docs/components/grid/demo.ts
  • packages/raystack/CHANGELOG.md
  • packages/raystack/components/data-table/hooks/useFilters.tsx
  • apps/www/src/content/docs/components/flex/demo.ts
  • apps/www/src/content/docs/components/empty-state/demo.ts
  • packages/raystack/components/avatar/tests/avatar.test.tsx
  • apps/www/src/content/docs/components/menu/demo.ts
  • apps/www/src/content/docs/components/toggle/demo.ts
  • apps/www/src/content/docs/components/progress/demo.ts
  • apps/www/src/lib/utils.ts
  • apps/www/src/content/docs/components/callout/demo.ts
  • apps/www/src/content/docs/components/code-block/demo.ts

Comment thread apps/www/src/app/examples/table/page.tsx
Comment thread apps/www/src/content/docs/components/amount/demo.ts
Comment thread apps/www/src/content/docs/components/tabs/props.ts Outdated
Comment thread packages/raystack/components/data-table/components/filters.tsx Outdated
Comment thread packages/raystack/CHANGELOG.md
Comment thread packages/raystack/components/command/command-root.tsx
Comment thread apps/www/src/content/docs/components/form/props.ts
Comment thread apps/www/src/content/docs/components/tabs/props.ts
Comment thread apps/www/src/content/docs/components/radio/props.ts
Comment thread packages/raystack/components/filter-chip/filter-chip.tsx Outdated
@Shreyag02 Shreyag02 changed the title removed unnecessary usage ts-ignore typescript strictness cleanup May 5, 2026
@rohanchkrabrty rohanchkrabrty merged commit 78b7563 into main May 5, 2026
4 of 5 checks passed
@rohanchkrabrty rohanchkrabrty deleted the fix/typescript-strictness-cleanup branch May 5, 2026 08:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants