Fix noUncheckedIndexedAccess undefineds#106
Conversation
Vite default tsconfig apparently suggests this extra strictness flag. (Semver patch version bump) Reported as TS errors when consuming butterfloat with `noUncheckedIndexedAccess` compiler option enabled. Fixes #104
There was a problem hiding this comment.
Pull Request Overview
Addresses TypeScript errors under the noUncheckedIndexedAccess compiler option by asserting non-null values where indexing/splitting could be flagged as possibly undefined. Also bumps package version for a patch release.
- Add non-null assertions to array/object index accesses and split results in production and test code
- Patch version bump to 1.6.5
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| static-dom.ts | Add non-null assertions for namespace lookups and element/attribute names derived from split to satisfy noUncheckedIndexedAccess |
| static-dom.test.tsx | Add non-null assertions in tests when indexing arrays of binds/selectors |
| stamp.test.tsx | Add non-null assertions when destructuring from indexed arrays in tests |
| events.test.ts | Add non-null assertion when reading events.click in tests |
| package.json | Bump version to 1.6.5 |
| jsr.json | Bump version to 1.6.5 |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Just want to clarify that the usage of the additional strictness flags isn't something that's imposed by Vite, at least to my knowledge. I mentioned Vite in case it helped with trying to reproduce the issue but most of the TS configurations come from personal experience and or being informed via resources like https://tsconfig.guide/ |
Vite default tsconfig apparently suggests this extra strictness flag.
(Semver patch version bump)
Reported as TS errors when consuming butterfloat with
noUncheckedIndexedAccesscompiler option enabled.Fixes #104