results object doc states that Check ids may be the same as Rule ids. This is a bit confusing.
Would be helpful if more info is provided
So a rule can be composed of multiple checks or sometimes a single check. Checks can also be used in multiple rules. So in a lot of cases, the check id is different than the rule id.
However there are some single purpose rules that run only a single check, and that check is not run in any other rule. In these cases, the check ID and the rule ID will probably be the same.
We do not have a list of checks like we do rules.
Thanks for the clarification. Is there a documented list of checks and their corresponding mapping to rule ids ?
As far as I know there is not.
Is there something specific you're looking for? Usually our documentation is only focused on rules since checks are just code snippets that look at certain things in the page.
No nothing specific. Was just surprised when I encountered check ids that were different than rule ids as I had assumed them to be the same. Thanks.
@straker A related question about Checks - there are 3 categories of checks: any, all, none. But in my usage so far I have seen only any being used. Are all and none used in any workflows? Or are they legacy remnants ?
any - Array of checks that were made where at least one must have passed.
all - Array of checks that were made where all must have passed. Each entry in the array contains the same information as the 'any' array
none - Array of checks that were made where all must have not passed. Each entry in the array contains the same information as the 'any' array
They're used in a few rules. all is used in aria-valid-attr-value and autocomplete-valid for example, and none is used in aria-roles and video-caption (as well as others)
Thanks for the clarification @straker
have couple more questions about the results object:
data - Additional information that is specific to the type of Check which is optional
From what I have seen when a check contains data or relatedNodes, there are no other checks in the node. Is this observation valid? If so I guess then the dataor relatedNodes can be output with the node rather than the check (for my purposes)?
Also observing that data can be a string or a list of strings or an object. Any logic behind this?
I'm unsure about the exact uses of data. I know I've seen it used a lot in color-contrast rules to say exactly why the element couldn't be determined for color-contrast. I'm also unaware of if there's a pattern with how it's used.
Sorry, couldn't be as helpful with that one. Maybe @WilcoFiers or @dylanb can answer.
@mohanraj-r
data is used in checks to compile the output message. For example if an ARIA attribute is invalid, data may include which attributes are invalid. There is no predefined format for them, it's different for different checks, depending on what's needed for the messages.