chore: resolve all 86 ESLint findings#75
Merged
Conversation
- 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eslint-disableonly where the rule misfires on legitimate native or wrapper patternsWhat changed
DatePicker: each day button wrapped in<div role="gridcell">witharia-selectedon the gridcellDocumentCanvas: arrow-key panning when zoomed, plusrole="application",aria-label, conditionaltabIndexSmsOtpField: removedaria-invalidfromrole="group"(not supported there) and applied to each digit input; also removed a stray no-op arrow expression inonFocusTabs:tabIndex={-1}on thetablistDatePicker.stories: replaced unattached<label>with<div>+aria-labelonDatePicker<dialog>backdrop-click inDialog/Drawer, andInput/Selectwrapper divs that forward clicks to real inputs (which themselves provide full keyboard support)render: (args) => { …useState… }arrows torender: function PascalNameRender(args) {…}inDialog,FileUpload,SegmentGroup, andViewstories soreact-hooks/rules-of-hooksrecognizes them as componentsObject.hasOwninstead ofobj.hasOwnProperty, optional catch bindings, removed unusedrequires and a deadorigLogcaptureanytypes withRecord<string, unknown>, structural types, or inferred Storybook arg types where straightforward;Toast.storiessimplifiedposition={undefined as any}toposition={undefined}since the prop is already optionalTest plan
npm run lint— 0 errors, 0 warningsnpm run test:unit— 438/438 passingnpx tsc --noEmit— no new errors (existing.figma.tsxerrors are unrelated)npm run test:visual— pre-existing infrastructure issue onmain(getByTestId('spec')strict-mode violations); not caused by this branchDatePickerin Storybook to confirm the gridcell wrapping didn't disrupt the 7-column grid layout