Skip to content

fix: ensure components compile under noUncheckedIndexedAccess#568

Open
tobigumo wants to merge 1 commit into
chakra-ui:mainfrom
tobigumo:fix/template-strict-index-access
Open

fix: ensure components compile under noUncheckedIndexedAccess#568
tobigumo wants to merge 1 commit into
chakra-ui:mainfrom
tobigumo:fix/template-strict-index-access

Conversation

@tobigumo
Copy link
Copy Markdown
Contributor

Summary

  • Enable noUncheckedIndexedAccess in the components template tsconfig so downstream CLI consumers with strict tsconfig no longer hit type errors on the shipped templates
  • Fix file-upload FileText in both react and solid: the length === 1 guard did not narrow indexed access; replaced with destructuring + truthy check so neither ?. nor ! is required
  • Fix solid checkbox/indeterminate example by capturing the indexed value locally so the truthy guard narrows for the subsequent spread
  • Regenerate the file-upload registry output to match the updated source

Test plan

  • bun run typecheck passes in components/react and components/solid
  • Registry output for file-upload regenerated; other registry JSONs left untouched

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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