pull/13557/head
Simon Holthausen 11 months ago
parent 8d0135ff01
commit b504a44b8e

@ -279,7 +279,7 @@ generated: 'generated by process-messages/index.js'
## `import_svelte_internal_forbidden` ## `import_svelte_internal_forbidden`
> [!NOTE] Imports of 'svelte/internal/*' are forbidden. It contains private runtime code which is subject to change without notice. If you're importing from 'svelte/internal/*' to work around a limitation of Svelte, please open an issue at https://github.com/sveltejs/svelte and explain your use case > [!NOTE] Imports of 'svelte/internal/\*' are forbidden. It contains private runtime code which is subject to change without notice. If you're importing from 'svelte/internal/\*' to work around a limitation of Svelte, please open an issue at https://github.com/sveltejs/svelte and explain your use case
## `invalid_arguments_usage` ## `invalid_arguments_usage`

@ -25,6 +25,7 @@ You can list multiple rules in a single comment (separated by commas), and add a
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. 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.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: Avoid using accesskey --> <!-- A11y: Avoid using accesskey -->
<div accesskey="z"></div> <div accesskey="z"></div>
@ -43,7 +44,7 @@ An element with `aria-activedescendant` must be tabbable, so it must either have
## `a11y_aria_attributes` ## `a11y_aria_attributes`
> [!NOTE] '\<%name%>' should not have 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. 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.
@ -376,6 +377,7 @@ A non-interactive element does not support event handlers (mouse and key handler
Tab key navigation should be limited to elements on the page that can be interacted with. Tab key navigation should be limited to elements on the page that can be interacted with.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: noninteractive element cannot have nonnegative tabIndex value --> <!-- A11y: noninteractive element cannot have nonnegative tabIndex value -->
<div tabindex="0"></div> <div tabindex="0"></div>
@ -401,6 +403,7 @@ Some HTML elements have default ARIA roles. Giving these elements an ARIA role t
Elements like `<div>` with interactive handlers like `click` must have an ARIA role. Elements like `<div>` with interactive handlers like `click` must have an ARIA role.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: <div> with click handler must have an ARIA role --> <!-- A11y: <div> with click handler must have an ARIA role -->
<div onclick={() => ''}></div> <div onclick={() => ''}></div>
@ -412,6 +415,7 @@ Elements like `<div>` with interactive handlers like `click` must have an ARIA r
Avoid positive `tabindex` property values. This will move elements out of the expected tab order, creating a confusing experience for keyboard users. Avoid positive `tabindex` property values. This will move elements out of the expected tab order, creating a confusing experience for keyboard users.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: avoid tabindex values above zero --> <!-- A11y: avoid tabindex values above zero -->
<div tabindex="1"></div> <div tabindex="1"></div>
@ -477,6 +481,7 @@ Enforce that only known ARIA attributes are used. This is based on the [WAI-ARIA
Elements with ARIA roles must use a valid, non-abstract ARIA role. A reference to role definitions can be found at [WAI-ARIA](https://www.w3.org/TR/wai-aria/#role_definitions) site. Elements with ARIA roles must use a valid, non-abstract ARIA role. A reference to role definitions can be found at [WAI-ARIA](https://www.w3.org/TR/wai-aria/#role_definitions) site.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: Unknown role 'toooltip' (did you mean 'tooltip'?) --> <!-- A11y: Unknown role 'toooltip' (did you mean 'tooltip'?) -->
<div role="toooltip"></div> <div role="toooltip"></div>

@ -81,4 +81,4 @@ To resolve this, ensure you're comparing values where both values were created w
> [!NOTE] Value cannot be cloned with '$state.snapshot' — the original value was returned > [!NOTE] Value cannot be cloned with '$state.snapshot' — the original value was returned
> [!NOTE] The following properties cannot be cloned with '$state.snapshot' — the return value contains the originals: > [!NOTE] The following properties cannot be cloned with '$state.snapshot' — the return value contains the originals:
%properties% > %properties%

@ -4,6 +4,7 @@
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. 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.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: Avoid using accesskey --> <!-- A11y: Avoid using accesskey -->
<div accesskey="z"></div> <div accesskey="z"></div>
@ -355,6 +356,7 @@ A non-interactive element does not support event handlers (mouse and key handler
Tab key navigation should be limited to elements on the page that can be interacted with. Tab key navigation should be limited to elements on the page that can be interacted with.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: noninteractive element cannot have nonnegative tabIndex value --> <!-- A11y: noninteractive element cannot have nonnegative tabIndex value -->
<div tabindex="0"></div> <div tabindex="0"></div>
@ -380,6 +382,7 @@ Some HTML elements have default ARIA roles. Giving these elements an ARIA role t
Elements like `<div>` with interactive handlers like `click` must have an ARIA role. Elements like `<div>` with interactive handlers like `click` must have an ARIA role.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: <div> with click handler must have an ARIA role --> <!-- A11y: <div> with click handler must have an ARIA role -->
<div onclick={() => ''}></div> <div onclick={() => ''}></div>
@ -391,6 +394,7 @@ Elements like `<div>` with interactive handlers like `click` must have an ARIA r
Avoid positive `tabindex` property values. This will move elements out of the expected tab order, creating a confusing experience for keyboard users. Avoid positive `tabindex` property values. This will move elements out of the expected tab order, creating a confusing experience for keyboard users.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: avoid tabindex values above zero --> <!-- A11y: avoid tabindex values above zero -->
<div tabindex="1"></div> <div tabindex="1"></div>
@ -456,6 +460,7 @@ Enforce that only known ARIA attributes are used. This is based on the [WAI-ARIA
Elements with ARIA roles must use a valid, non-abstract ARIA role. A reference to role definitions can be found at [WAI-ARIA](https://www.w3.org/TR/wai-aria/#role_definitions) site. Elements with ARIA roles must use a valid, non-abstract ARIA role. A reference to role definitions can be found at [WAI-ARIA](https://www.w3.org/TR/wai-aria/#role_definitions) site.
<!-- prettier-ignore -->
```svelte ```svelte
<!-- A11y: Unknown role 'toooltip' (did you mean 'tooltip'?) --> <!-- A11y: Unknown role 'toooltip' (did you mean 'tooltip'?) -->
<div role="toooltip"></div> <div role="toooltip"></div>

@ -126,7 +126,16 @@ for (const [category, codes] of Object.entries(consolidated_messages)) {
for (const message of messages) { for (const message of messages) {
// Replace backticks with single quotes to avoid markdown formatting it to code blocks // Replace backticks with single quotes to avoid markdown formatting it to code blocks
// Also make sure to escape < to avoid markdown interpreting it as an HTML tag // Also make sure to escape < to avoid markdown interpreting it as an HTML tag
lines.push('> [!NOTE] ' + message.replaceAll('`', "'").replace(/(?<!\\)</g, '\\<') + '\n'); lines.push(
'> [!NOTE] ' +
message
.replaceAll('`', "'")
.replace(/(?<!\\)</g, '\\<')
.replace(/(?<!\\)\*/g, '\\*')
.split('\n')
.join('\n> ') +
'\n'
);
} }
if (details) { if (details) {
lines.push(details + '\n'); lines.push(details + '\n');

Loading…
Cancel
Save