Enable noUncheckedIndexedAccess to catch out-of-bounds array bugs
SkillDev toolsno-unchecked-indexed-access is a skill that guides an AI agent through auditing tsconfig.json for missing safety flags, reviewing code that uses array index access in data processing pipelines, and investigating runtime undefined errors that TypeScript did not catch. It helps catch unchecked array access bugs by checking TypeScript configs for strict indexing rules.
Use Enable noUncheckedIndexedAccess to catch out-of-bounds array bugs in Claude, ChatGPT or Ahel Desktop
Free. Sign in, add Enable noUncheckedIndexedAccess to catch out-of-bounds array bugs and connect your AI. About a minute.
Also: Claude Code · Cursor · Codex
Then ask your AI: use the Enable noUncheckedIndexedAccess to catch out-of-bounds array bugs skill
Details
Instructions available. Your AI can read the instructions. Execution depends on the setup they require.
Account requirements not reviewed. Check the skill instructions before use; ahel provides instructions and does not run this skill.
No other account needed.
Have a TypeScript project with a tsconfig.json available to the agent.
What your AI can do with it
- Audit tsconfig.json for missing safety flags
- Review code that uses array index access in data processing pipelines
- Investigate runtime undefined errors that TypeScript did not catch
- Check TypeScript configs for strict indexing rules so unchecked array access bugs get
Getting started
- Have a TypeScript project with a tsconfig.json available to the agent.
- Add the no-unchecked-indexed-access skill to the agent's available skills.
- Ask the agent to audit the TypeScript config or review array index access in the code.
What this skill tells your AI
The instructions your AI receives, as published by thedaviddias/front-end-checklist in skills/no-unchecked-indexed-access/SKILL.md and read by ahel’s review.
TypeScript's default behaviour types array[0] as T, pretending the access is always safe. In reality, the array might be empty or the index might be out of range, leading to silent undefined values that cause downstream crashes. Enabling noUncheckedIndexedAccess surfaces these potential failures as type errors at compile time, requiring developers to prove the access is safe before the code runs.
Quick Reference
- Without the flag, array[0] is typed as T even if the array is empty
- noUncheckedIndexedAccess changes array[n] to return T | undefined
- Forces an explicit check before using any array element accessed by index
- Optional chaining and nullish coalescing handle most false positives cleanly
Check
Check whether noUncheckedIndexedAccess is enabled in the project's tsconfig.json. If not, scan for array index accesses (arr[0], arr[i]) that could fail if the array is shorter than expected.
Fix
Enable noUncheckedIndexedAccess in tsconfig.json, then update any array index accesses that TypeScript now flags to include an explicit undefined check or use optional chaining before the accessed value is used.
Explain
Explain what noUncheckedIndexedAccess does, why the default TypeScript behaviour is unsound for array index access, and how optional chaining and Array.at() interact with the flag.
Code Review
Review all array index accesses in this file (arr[0], arr[i], object[key]). Flag any location where the accessed value is used without a preceding undefined check, even if noUncheckedIndexedAccess is not yet enabled in the project.
For full implementation details, code examples, and framework-specific guidance,
see references/rule.md.
Rule page: https://frontendchecklist.io/en/rules/javascript/no-unchecked-indexed-access
Signals
- GitHub stars
- 74k
- Forks
- 7k
- Last commit
- Oct 2026
Questions
- When should this skill be used?
- Use it when auditing tsconfig.json for missing safety flags, reviewing code that uses array index access in data processing pipelines, or investigating runtime undefined errors that TypeScript did not catch.
- What does the skill do about unchecked array access?
- It guides the agent to check TypeScript configs for strict indexing rules so unchecked array access bugs get caught.
- Does it fix the code automatically?
- The item does not say; it describes guiding the agent through audits, reviews, and investigations.
Advanced
- Item type
- skill
- Key
no-unchecked-indexed-access- Source
- github.com/thedaviddias/front-end-checklist
github.com/thedaviddias/front-end-checklist