Skip to content

Commit

Permalink
Merge pull request #254 from microbit-foundation/253-disable-a11y-war…
Browse files Browse the repository at this point in the history
…nings-from-compiler

Disabled a11y warnings
  • Loading branch information
r59q authored Jul 3, 2023
2 parents b128f00 + 34cb27c commit d1a30a7
Showing 1 changed file with 36 additions and 1 deletion.
37 changes: 36 additions & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export default defineConfig({
preprocess: sveltePreprocess({ typescript: true }),

onwarn(warning, defaultHandler) {
/*if (warning.code.includes('a11y')) return; <- This disabled A11y warnings */
if (warning.code.includes('a11y')) return; // Ignores the a11y warnings when compiling. This does not apply to the editor, see comment at bottom for vscode instructions

// handle all other warnings normally
defaultHandler!(warning);
Expand All @@ -26,3 +26,38 @@ export default defineConfig({
},
},
});

/**
To disable a11y warnings in vscode:
create file .vscode/settings.json and place
{
"svelte.plugin.svelte.compilerWarnings": {
"a11y-aria-attributes": "ignore",
"a11y-incorrect-aria-attribute-type": "ignore",
"a11y-unknown-aria-attribute": "ignore",
"a11y-hidden": "ignore",
"a11y-misplaced-role": "ignore",
"a11y-unknown-role": "ignore",
"a11y-no-abstract-role": "ignore",
"a11y-no-redundant-roles": "ignore",
"a11y-role-has-required-aria-props": "ignore",
"a11y-accesskey": "ignore",
"a11y-autofocus": "ignore",
"a11y-misplaced-scope": "ignore",
"a11y-positive-tabindex": "ignore",
"a11y-invalid-attribute": "ignore",
"a11y-missing-attribute": "ignore",
"a11y-img-redundant-alt": "ignore",
"a11y-label-has-associated-control": "ignore",
"a11y-media-has-caption": "ignore",
"a11y-distracting-elements": "ignore",
"a11y-structure": "ignore",
"a11y-click-events-have-key-events": "ignore",
"a11y-missing-content": "ignore",
}
}
Add configuration values as needed.
*/

0 comments on commit d1a30a7

Please sign in to comment.