You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at the jsx-a11y/lang source code and jsx-a11y/html-has-lang source code, it appears that the latter ensures that html elements have a lang attribute with any value and the former additionally checks if the lang attribute's value conforms to the BCP 47 list of acceptable tags. To satisfy WCAG 3.1.1, technique H57 is sufficient but that technique requires both of the following to be true:
html element has a lang attribute (checked by rule jsx-a11y/html-has-lang, included in jsx-a11y/strict)
lang attribute conforms to BCP 47 (checked by rule jsx-a11y/lang, NOT included in jsx-a11y/strict)
Proposal:
In order to wholly satisfy WCAG 3.1.1:
jsx-a11y/lang MUST be included in jsx-a11y/strict
jsx-a11y/lang SHOULD be included jsx-a11y/recommended1
1: I am not sure what the criteria is for including a rule in jsx-a11y/recommended but given that WCAG 3.1.1 would only be sufficiently covered with the inclusion of jsx-a11y/lang, I think it would make sense to include the rule in both configs.
The text was updated successfully, but these errors were encountered:
I think that's a good middle ground. I'd be happy to make a pull request with the TODO comment. Let me know if that is acceptable and, if so, what contributing guidelines/docs there are (I couldn't find any in the repo). Thanks!
Current state
jsx-a11y/strict
does not include thejsx-a11y/lang
rule but does include thejsx-a11y/html-has-lang
rule.Context
Looking at the
jsx-a11y/lang
source code andjsx-a11y/html-has-lang
source code, it appears that the latter ensures thathtml
elements have alang
attribute with any value and the former additionally checks if thelang
attribute's value conforms to the BCP 47 list of acceptable tags. To satisfy WCAG 3.1.1, technique H57 is sufficient but that technique requires both of the following to be true:html
element has alang
attribute (checked by rulejsx-a11y/html-has-lang
, included injsx-a11y/strict
)lang
attribute conforms to BCP 47 (checked by rulejsx-a11y/lang
, NOT included injsx-a11y/strict
)Proposal:
In order to wholly satisfy WCAG 3.1.1:
jsx-a11y/lang
MUST be included injsx-a11y/strict
jsx-a11y/lang
SHOULD be includedjsx-a11y/recommended
11: I am not sure what the criteria is for including a rule in
jsx-a11y/recommended
but given that WCAG 3.1.1 would only be sufficiently covered with the inclusion ofjsx-a11y/lang
, I think it would make sense to include the rule in both configs.The text was updated successfully, but these errors were encountered: