diff --git a/documentation/docs/98-reference/30-compiler-warnings.md b/documentation/docs/98-reference/30-compiler-warnings.md index 9da02e0d78..6cc22d2e66 100644 --- a/documentation/docs/98-reference/30-compiler-warnings.md +++ b/documentation/docs/98-reference/30-compiler-warnings.md @@ -12,25 +12,46 @@ Some warnings may be incorrect in your concrete use case. You can disable such f ``` -You can list multiple rules in a single comment, and add an explanatory note alongside them: +You can list multiple rules in a single comment (separated by commas), and add an explanatory note (in parentheses) alongside them: ```svelte -
...
+
...
``` ## `a11y_accesskey` > [!NOTE] Avoid using accesskey +Enforce no `accesskey` on element. Access keys are HTML attributes that allow web developers to assign keyboard shortcuts to elements. Inconsistencies between keyboard shortcuts and keyboard commands used by screen reader and keyboard-only users create accessibility complications. To avoid complications, access keys should not be used. + +```svelte + +
+``` + ## `a11y_aria_activedescendant_has_tabindex` > [!NOTE] An element with an aria-activedescendant attribute should have a tabindex value +An element with `aria-activedescendant` must be tabbable, so it must either have an inherent `tabindex` or declare `tabindex` as an attribute. + +```svelte + +
+``` + ## `a11y_aria_attributes` > [!NOTE] '\<%name%>' should not have aria-* attributes +Certain reserved DOM elements do not support ARIA roles, states and properties. This is often because they are not visible, for example `meta`, `html`, `script`, `style`. This rule enforces that these DOM elements do not contain the `aria-*` props. + +```svelte + + +``` + ## `a11y_autocomplete_valid` > [!NOTE] '%value%' is an invalid value for 'autocomplete' on '\' @@ -39,10 +60,30 @@ You can list multiple rules in a single comment, and add an explanatory note alo > [!NOTE] Avoid using autofocus +Enforce that `autofocus` is not used on elements. Autofocusing elements can cause usability issues for sighted and non-sighted users alike. + +```svelte + + +``` + ## `a11y_click_events_have_key_events` > [!NOTE] Visible, non-interactive elements with a click event must be accompanied by a keyboard event handler. Consider whether an interactive element such as '\