This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 656
Conversation
This file contains 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
✅ Deploy Preview for docs-rometools canceled.
|
Parser conformance results on ubuntu-latestjs/262
jsx/babel
symbols/microsoft
ts/babel
ts/microsoft
|
ematipico
force-pushed
the
feat/aria-roles
branch
from
November 23, 2022 11:14
0585fbc
to
69c9d21
Compare
MichaReiser
reviewed
Nov 23, 2022
properties: Arc<AriaProperties>, | ||
} | ||
|
||
impl AriaServices { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative to having a service could be to use lazy_static
and expose the roles and properties globally.
MichaReiser
reviewed
Nov 23, 2022
leops
reviewed
Nov 23, 2022
ematipico
force-pushed
the
feat/aria-roles
branch
from
November 28, 2022 14:22
69c9d21
to
a6e61cc
Compare
ematipico
force-pushed
the
feat/aria-roles
branch
2 times, most recently
from
November 28, 2022 14:35
5eb67c0
to
d4eba05
Compare
ematipico
force-pushed
the
feat/aria-roles
branch
from
November 28, 2022 14:38
d4eba05
to
e4a09df
Compare
ematipico
force-pushed
the
feat/aria-roles
branch
from
November 28, 2022 14:40
e4a09df
to
540acb9
Compare
leops
reviewed
Nov 28, 2022
crates/rome_js_analyze/src/aria_analyzers/nursery/use_aria_props_for_role.rs
Outdated
Show resolved
Hide resolved
leops
approved these changes
Nov 28, 2022
This was referenced Nov 28, 2022
Closed
Closed
Closed
2 tasks
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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
This is the first step towards having some APIs to get information about ARIA properties and ARIA roles.
What this PR does
The amount of metadata around ARIA properties and ARIA roles is very big, and it can get bigger with time, here's what we need to eventually support:
This is a list of the metadata that I once created when I implemented the ARIA rules in rome classic. This metadata was copied from the existing
eslint-plugin-jsx-a11y
, which was a crafted data list from https://www.w3.org/TR/wai-aria-1.1Considering the amount of information, I thought we could opt-in this metadata using the same query system we use for the semantic model. Fortunately, rules that involve ARIA should not involve the semantic model, so this works perfectly for us.
There's some generated code in an attempt to make the metadata small, but if you have some enhancements, please share!
I could plan to add the generated code using
build.rs
, but not in this PR (I tried before but I had some issues at compile time).I also added a new API to the
RuleDiagnostic
, callednote_list
. You can see the results in the diagnostics.This PR adds new rules that use the newly added APIs:
useAriaProps
useAriaPropTypes
The two rules are not exhaustive and that's the plan for this PR. I wanted to at least add a couple of failing cases to get a feeling of how the APIs should be crafted.
What this PR doesn't do
Test Plan
There are some doc tests to make sure that we don't overflow the stack, considering that we directly access an array. I also added snapshots for the new rules.