Repository navigation
MAINT: Enable jsx-a11y lint and make the converter panel resizable by keyboard - #4074
Open
Everton (evertonrocha2) wants to merge 1 commit into
Open
Everton (evertonrocha2) wants to merge 1 commit into
Everton (evertonrocha2) wants to merge 1 commit into
Conversation
… keyboard Add eslint-plugin-jsx-a11y with its recommended rules as errors for production components. Make the ConverterPanel resize handle a focusable WAI-ARIA window splitter, and document the remaining triaged exceptions inline. Closes microsoft#3726
Author
|
@microsoft-github-policy-service agree |
This branch has not been deployed
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.
Description
Closes #3726.
Adds
eslint-plugin-jsx-a11yto the frontend lint and makes its recommended rules blocking for production components (src/**/*.tsx, tests excluded). I triaged the 25 findings on current main:Fixed (1)
ConverterPanelresize handle only worked with a mouse. It's now a focusablerole="separator"(WAI-ARIA window splitter): Left/Right resize by 16px, Home/End jump to the min/max width, andaria-valuenow/min/maxexpose the current width.Handled in config (9)
no-noninteractive-tabindexalso allowsrole="region"androle="separator", so labelled scroll regions (3) and the new splitter can take focus.media-has-captionis off (6). Every<audio>/<video>here renders user-supplied attack content or target output, so there's no caption track to provide.Inline disables, each with a reason (15 findings, 14 comments)
<section>and a<pre>) that need focus to scroll with the keyboard.LabelsBar(2 elements, 4 findings). The pill's click handler only catches clicks on its own padding. The inner edit control already hasrole="button",tabIndexandonKeyDown.ObjectiveHeaderautoFocus: focus moves into the inline editor the user just opened.TechniqueEditor: theonKeyDownonly keeps Enter in a field from submitting the form.ConverterPanelseparator: jsx-a11y treatsseparatoras non-interactive even when it's focusable (jsx-a11y/eslint-plugin-jsx-a11y#577).Lint already runs with
--report-unused-disable-directives, so a stale disable will fail CI too.Notes
eslint-plugin-jsx-a11y6.10.2 lists peer deps up to ESLint 9, but it runs fine on ESLint 10, and the repo's.npmrcalready setslegacy-peer-deps. Happy to switch to the maintained forkeslint-plugin-jsx-a11y-xif you prefer. It gives the same results here.es-object-atoms(1.1.1 to 1.1.2, patch).<span>s witharia-label, which some screen readers ignore. Fluent'sdisabledFocusableonButtoncould replace most of them.Tests and Documentation
ConverterPanel.test.tsx: the handle is exposed as a focusable separator with its current width, and Arrow/Home/End resize it within bounds.npm run lintandtsc --noEmitpass. I also checked that a new<div onClick>in a component now fails lint.