Skip to content

Conversation

kpedrok
Copy link

@kpedrok kpedrok commented Oct 10, 2025

Description

Removes @ts-nocheck directive and adds proper TypeScript type annotations to apps/www/lib/toc.ts.

Fixes 8 implicit any type errors that were previously suppressed.

Changes

  • Removed @ts-nocheck and TODO comment
  • Added UnistNode type import from types/unist
  • Added type annotations to all function parameters
  • Added null safety with optional chaining
  • Added explicit string[] array type
  • No logic changes

Testing

Build verification:

pnpm --filter=www dev

Application builds successfully. Table of contents functionality on documentation pages works correctly.

Note

Running npx tsc lib/toc.ts in isolation shows a module resolution warning for types/unist. This is expected behavior - the import resolves correctly during actual builds using the baseUrl configuration in tsconfig.json, consistent with other files in the project (rehype-component.ts, rehype-npm-command.ts).

Summary

Before: 8 TypeScript implicit any errors hidden by @ts-nocheck
After: Fully type-safe with zero errors

Removes @ts-nocheck directive and adds proper type annotations to resolve
8 implicit any type errors. Uses existing UnistNode type from types/unist
and adds null safety with optional chaining.

No logic changes - only type improvements for better type safety.
Copy link

vercel bot commented Oct 10, 2025

@kpedrok is attempting to deploy a commit to the shadcn-pro Team on Vercel.

A member of the Team first needs to authorize it.

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.

1 participant