Skip to content

Handle unresolved accessibility action entries - #169

Open
marcshilling wants to merge 1 commit into
FormidableLabs:masterfrom
marcshilling:codex/fix-undefined-accessibility-actions
Open

Handle unresolved accessibility action entries#169
marcshilling wants to merge 1 commit into
FormidableLabs:masterfrom
marcshilling:codex/fix-undefined-accessibility-actions

Conversation

@marcshilling

@marcshilling marcshilling commented Jul 24, 2026

Copy link
Copy Markdown

What changed

Skip undefined entries returned by jsx-ast-utils while inspecting an accessibilityActions array.

Why

When an array contains conditional spreads that cannot be resolved statically, getPropValue can return undefined for those entries. The rule currently assumes every evaluated entry is an object and reads action.name, which throws a TypeError and terminates the entire ESLint run.

Skipping only unresolved entries lets ESLint continue while preserving the existing diagnostics for other invalid values.

My code that was crashing this

accessibilityActions={[
  ...(index > 0 ? [{ name: 'decrement' }] : []),
  ...(index < items.length - 1 ? [{ name: 'increment' }] : []),
]}

Verification

  • yarn lint
  • yarn flow
  • yarn test:ci (212 tests)
  • yarn build
  • Manually ran the built rule against a conditional-spread reproduction

@marcshilling
marcshilling marked this pull request as ready for review July 24, 2026 14:19
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