eslint-plugin-jsx-a11y
eslint-plugin-jsx-a11y copied to clipboard
[new rule] Dialog and Alert role elements have a label
Elements with the role ARIA role dialog or alert require a label either provided by aria-label or aria-labelledby.
I see this recommended for the dialog but it's not recommended nor implemented for alert.
Is there some general consensus for this plugin if the rules should follow the WAI-ARIA authoring practices or not?
@ljharb Back to July, Jesse suggested to have a new rule for this one, something like window-has-title, but it seems to be already covered in control-has-associated-label, in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/tests/src/rules/control-has-associated-label-test.js I can see valid cases '<div role="dialog" /> and '<div role="alertdialog" />', what you think?
I agree, this use case seems covered. Happy to reopen if not.
@ljharb Back to July, Jesse suggested to have a new rule for this one, something like window-has-title, but it seems to be already covered in control-has-associated-label, in https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/tests/src/rules/control-has-associated-label-test.js I can see
valid cases '<div role="dialog" /> and '<div role="alertdialog" />', what you think?
Great catch!