Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a11y no-noninteractive-element-to-interactive-role #8167

Conversation

ngtr6788
Copy link
Contributor

@ngtr6788 ngtr6788 commented Jan 5, 2023

Hey everyone, this is my first time contributing to the Svelte project as well as open source in general. 👋

I noticed that there are a few accessibility checks remaining in #820 and I picked up no-noninteractive-element-to-interactive-role (not to be confused by no-interactive-element-to-noninteractive-role, which was already done #5955).

However, I have a small question: There are cases where this rule doesn't apply if we set it under eslint-jsx recommended settings but is applied under strict settings. Are we using the strict settings here? (edited because I asked another question and already found the answer)

My test plan:

  • Test random combinations of non-interactive elements with interactive roles
  • Test div-role combinations
  • Test non-interactive roles with non-interactive elements to make sure the rule doesn't pick those

Let me know if there are improvements or comments you want to make!

Before submitting the PR, please make sure you do the following

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • Prefix your PR title with [feat], [fix], [chore], or [docs].
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with npm test and lint the project with npm run lint

@ngtr6788 ngtr6788 marked this pull request as draft January 5, 2023 15:37
@ngtr6788 ngtr6788 marked this pull request as ready for review January 5, 2023 21:14
@ngtr6788 ngtr6788 changed the title feat: Add a11y no-noninteractive-element-to-interactive-role (#820) feat: Add a11y no-noninteractive-element-to-interactive-role Jan 5, 2023
@ngtr6788 ngtr6788 changed the title feat: Add a11y no-noninteractive-element-to-interactive-role [feat]: Add a11y no-noninteractive-element-to-interactive-role Jan 6, 2023
@ngtr6788 ngtr6788 changed the title [feat]: Add a11y no-noninteractive-element-to-interactive-role [feat] Add a11y no-noninteractive-element-to-interactive-role Jan 6, 2023
@ngtr6788 ngtr6788 force-pushed the a11y-no-noninteractive-element-to-interactive-role branch from 2f2956c to 14a3131 Compare January 8, 2023 02:04
@benmccann benmccann changed the title [feat] Add a11y no-noninteractive-element-to-interactive-role feat: add a11y no-noninteractive-element-to-interactive-role Jan 12, 2023
@vercel
Copy link

vercel bot commented Feb 27, 2023

@ngtr6788 is attempting to deploy a commit to the Svelte Team on Vercel.

A member of the Team first needs to authorize it.

@dummdidumm
Copy link
Member

As noted in #8251 (comment), could you keep the boolean methods (making them simple wrapper methods of your new enum-returning methods)? This would reduce the things changed and (IMO) makes the code a bit more readable on the usage side. Code looks good otherwise!

@dummdidumm dummdidumm added this to the 3.x milestone Mar 1, 2023
@ngtr6788
Copy link
Contributor Author

ngtr6788 commented Mar 1, 2023

Sounds good! I just pushed the wrapper method you mentioned now!

Copy link
Member

@dummdidumm dummdidumm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@dummdidumm dummdidumm merged commit 26c38e7 into sveltejs:master Mar 14, 2023
@ngtr6788 ngtr6788 deleted the a11y-no-noninteractive-element-to-interactive-role branch March 14, 2023 21:25
@Conduitry
Copy link
Member

This has been released in 3.57.0 - thank you!

@ngtr6788
Copy link
Contributor Author

You're welcome!

dummdidumm added a commit to dummdidumm/svelte that referenced this pull request Mar 20, 2023
sveltejs#8167 introduced the strict version of it - until this is configurable, we should use the relaxed version instead, since many a11y docs actually advise using ul/ol etc
dummdidumm added a commit that referenced this pull request Mar 21, 2023
…ng (#8402)

#8167 introduced the strict version of it - until this is configurable, we should use the relaxed version instead, since many a11y docs actually advise using ul/ol etc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants