mirror of https://github.com/sveltejs/svelte
fix: don't warn about redundant `link` role on `<area>` without `href` (#18872)
Since #11737, `<a role="link">` without an `href` no longer triggers `a11y_no_redundant_roles`, but `<area role="link">` without an `href` still does. Per [ARIA in HTML](https://www.w3.org/TR/html-aria/#el-area-no-href), an `<area>` without `href` has the implicit role `generic` and `link` is one of its allowed roles, so the role isn't redundant. This applies the existing `<a>` exception to `<area>` and adds test cases for `<area>` with and without `href`. Closes #9261. The `<a>` example in that issue was already fixed by #11737, but the issue was left open. ### Before submitting the PR, please make sure you do the following - [x] 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 - [x] Prefix your PR title with `feat:`, `fix:`, `chore:`, or `docs:`. - [x] This message body should clearly illustrate what problems it solves. - [x] Ideally, include a test that fails without this PR but passes with it. - [x] If this PR changes code within `packages/svelte/src`, add a changeset (`npx changeset`). ### Tests and linting - [x] Run the tests with `pnpm test` and lint the project with `pnpm lint`pull/18871/merge
parent
f7ca0a44a5
commit
75aa6ba38d
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
'svelte': patch
|
||||||
|
---
|
||||||
|
|
||||||
|
fix: don't warn about a redundant `link` role on `<area>` elements without an `href`
|
||||||
Loading…
Reference in new issue