Skip to content

Add "noUncheckedIndexedAccess": true to compilerOptions#744

Merged
dskloetc merged 2 commits intomainfrom
kloet/checked-index-access
Apr 23, 2026
Merged

Add "noUncheckedIndexedAccess": true to compilerOptions#744
dskloetc merged 2 commits intomainfrom
kloet/checked-index-access

Conversation

@dskloetc
Copy link
Copy Markdown
Contributor

@dskloetc dskloetc commented Apr 22, 2026

Description

There was a bug in the iTick EA that could have been caught by the compiler if the compiler had realized that someArray[0] is undefined if the array is empty. But the compiler doesn't do that unless noUncheckedIndexedAccess is enabled.

If we change the generator template, we can make sure this option is enabled by default in future EAs.

Changes

  1. Add "noUncheckedIndexedAccess": true to "compilerOptions": { in scripts/generator-adapter/generators/app/templates/tsconfig.json.
  2. Update the generated code to satisfy the new compiler check.

Tested

In external-adapters-js:

  1. Use these instructions to point packages/scripts/package.json to the local framework repo with the change.
  2. Run yarn new and follow the instructions.
  3. Create an adapter with name abcd.
  4. Inspect the contents of packages/sources/abcd/tsconfig.json.
  5. Build the generated adapter.

@dskloetc dskloetc added the patch label Apr 22, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 22, 2026

NPM Publishing labels 🏷️

🟢 This PR has valid version labels and will cause a patch bump.

@dskloetc dskloetc marked this pull request as ready for review April 22, 2026 14:41
@dskloetc dskloetc requested a review from a team as a code owner April 22, 2026 14:41
@dskloetc dskloetc merged commit 6e34131 into main Apr 23, 2026
15 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Successfully created version bump PR: #745

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants