Skip to content

chore: resolve all 86 ESLint findings#75

Merged
revikornmann merged 1 commit into
mainfrom
revikornmann/lint-cleanup
May 10, 2026
Merged

chore: resolve all 86 ESLint findings#75
revikornmann merged 1 commit into
mainfrom
revikornmann/lint-cleanup

Conversation

@revikornmann
Copy link
Copy Markdown
Owner

Summary

  • Drives the project from 86 ESLint problems (50 errors, 36 warnings) to 0/0
  • Mostly real fixes; targeted eslint-disable only where the rule misfires on legitimate native or wrapper patterns

What changed

  • A11y (11 errors) — real semantic improvements:
    • DatePicker: each day button wrapped in <div role="gridcell"> with aria-selected on the gridcell
    • DocumentCanvas: arrow-key panning when zoomed, plus role="application", aria-label, conditional tabIndex
    • SmsOtpField: removed aria-invalid from role="group" (not supported there) and applied to each digit input; also removed a stray no-op arrow expression in onFocus
    • Tabs: tabIndex={-1} on the tablist
    • DatePicker.stories: replaced unattached <label> with <div> + aria-label on DatePicker
    • Targeted disables only for native <dialog> backdrop-click in Dialog/Drawer, and Input/Select wrapper divs that forward clicks to real inputs (which themselves provide full keyboard support)
  • Storybook hooks (13 errors) — converted render: (args) => { …useState… } arrows to render: function PascalNameRender(args) {…} in Dialog, FileUpload, SegmentGroup, and View stories so react-hooks/rules-of-hooks recognizes them as components
  • Scripts (~14 errors)Object.hasOwn instead of obj.hasOwnProperty, optional catch bindings, removed unused requires and a dead origLog capture
  • 36 warnings — removed unused imports/locals across components and tests; replaced any types with Record<string, unknown>, structural types, or inferred Storybook arg types where straightforward; Toast.stories simplified position={undefined as any} to position={undefined} since the prop is already optional

Test plan

  • npm run lint — 0 errors, 0 warnings
  • npm run test:unit — 438/438 passing
  • npx tsc --noEmit — no new errors (existing .figma.tsx errors are unrelated)
  • npm run test:visual — pre-existing infrastructure issue on main (getByTestId('spec') strict-mode violations); not caused by this branch
  • Manual: spot-check DatePicker in Storybook to confirm the gridcell wrapping didn't disrupt the 7-column grid layout

- Fix 11 a11y errors with real semantic improvements: gridcell wrappers
  in DatePicker, keyboard panning in DocumentCanvas, aria-invalid moved
  to digit inputs in SmsOtpField, focusable tablist in Tabs, and label
  association in DatePicker stories. Targeted eslint-disable with
  explanations only for native <dialog> backdrop click and the wrapper
  divs in Input/Select that forward clicks to real inputs.
- Convert 13 Storybook render arrows that call useState to named
  PascalCase function expressions so react-hooks/rules-of-hooks
  recognizes them as components (matches DatePicker.stories pattern).
- Replace obj.hasOwnProperty(key) with Object.hasOwn(obj, key) in
  scripts; convert unused catch bindings to optional catch; remove
  dead requires and an orphan no-op expression in SmsOtpField.
- Strip unused imports/locals across components and tests; replace
  any types with Record<string, unknown>, structural types, or
  inferred Storybook arg types where straightforward.

All 438 unit tests still pass. Visual tests have a pre-existing
strict-mode violation issue on main unrelated to this branch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@revikornmann revikornmann merged commit 6d3f8e1 into main May 10, 2026
1 check passed
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