From 73d09cc81395587a1a8f705cf9720774fe44913e Mon Sep 17 00:00:00 2001 From: jaig-0911 <63843872+jaig-0911@users.noreply.github.com> Date: Wed, 31 Jan 2024 12:36:21 +0530 Subject: [PATCH] fix: removed best practices rules from base and added them to extended (#636) --- packages/preset-rules/README.md | 34 ++++++++++---------- packages/preset-rules/__tests__/wcag.test.ts | 2 +- packages/preset-rules/src/base.ts | 17 ---------- packages/preset-rules/src/extended.ts | 17 ++++++++++ 4 files changed, 35 insertions(+), 35 deletions(-) diff --git a/packages/preset-rules/README.md b/packages/preset-rules/README.md index 70af04c5..1b9b7b62 100644 --- a/packages/preset-rules/README.md +++ b/packages/preset-rules/README.md @@ -37,7 +37,6 @@ console.log(a11yResults); | Rule ID | Description | WCAG SC | WCAG Level | Priority | In Base ruleset | In Extended ruleset | | -------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | ---------- | -------- | --------------- | ------------------- | -| [accesskeys](https://dequeuniversity.com/rules/axe/4.7/accesskeys) | Ensures every accesskey attribute value is unique | 4.1.1 | A | P3 | ✅ | ✅ | | [area-alt](https://dequeuniversity.com/rules/axe/4.7/area-alt) | Ensures <area> elements of image maps have alternate text | 1.1.1 | A | P1 | ✅ | ✅ | | [aria-allowed-attr](https://dequeuniversity.com/rules/axe/4.7/aria-allowed-attr) | Ensures ARIA attributes are allowed for an element's role | 4.1.2 | A | P1 | ✅ | ✅ | | [aria-allowed-role](https://dequeuniversity.com/rules/axe/4.7/aria-allowed-role) | Ensures role attribute has an appropriate value for the element | 4.1.2 | A | P1 | ✅ | ✅ | @@ -53,7 +52,6 @@ console.log(a11yResults); | [aria-required-parent](https://dequeuniversity.com/rules/axe/4.7/aria-required-parent) | Ensures elements with an ARIA role that require parent roles are contained by them | 4.1.2 | A | P1 | ✅ | ✅ | | [aria-roledescription](https://dequeuniversity.com/rules/axe/4.7/aria-roledescription) | Ensure aria-roledescription is only used on elements with an implicit or explicit role | 4.1.2 | A | P3 | ✅ | ✅ | | [aria-roles](https://dequeuniversity.com/rules/axe/4.7/aria-roles) | Ensures all elements with a role attribute use a valid value | 4.1.2 | A | P1 | ✅ | ✅ | -| [aria-text](https://dequeuniversity.com/rules/axe/4.7/aria-text) | Ensures "role=text" is used on elements with no focusable descendants | 4.1.1 | A | P3 | ✅ | ✅ | | [aria-toggle-field-name](https://dequeuniversity.com/rules/axe/4.7/aria-toggle-field-name) | Ensures every ARIA toggle field has an accessible name | 4.1.2 | A | P1 | ✅ | ✅ | | [aria-tooltip-name](https://dequeuniversity.com/rules/axe/4.7/aria-tooltip-name) | Ensures every ARIA tooltip node has an accessible name | 4.1.2 | A | P1 | ✅ | ✅ | | [aria-treeitem-name](https://dequeuniversity.com/rules/axe/4.7/aria-treeitem-name) | Ensures every ARIA treeitem node has an accessible name | 4.1.2 | A | P1 | ✅ | ✅ | @@ -72,40 +70,25 @@ console.log(a11yResults); | [duplicate-id](https://dequeuniversity.com/rules/axe/4.7/duplicate-id) | Ensures every id attribute value is unique | 4.1.1 | A | P3 | ✅ | ✅ | | [duplicate-id-active](https://dequeuniversity.com/rules/axe/4.7/duplicate-id-active) | Ensures every id attribute value of active elements is unique | 4.1.1 | A | P3 | ✅ | ✅ | | [duplicate-id-aria](https://dequeuniversity.com/rules/axe/4.7/duplicate-id-aria) | Ensures every id attribute value used in ARIA and in labels is unique | 4.1.2 | A | P1 | ✅ | ✅ | -| [empty-heading](https://dequeuniversity.com/rules/axe/4.7/empty-heading) | Ensures headings have discernible text | 1.3.1 | A | P2 | ✅ | ✅ | -| [empty-table-header](https://dequeuniversity.com/rules/axe/4.7/empty-table-header) | Ensures table headers have discernible text | 1.3.1 | A | P2 | ✅ | ✅ | | [form-field-multiple-labels](https://dequeuniversity.com/rules/axe/4.7/form-field-multiple-labels) | Ensures form field does not have multiple label elements | 2.5.3 | A | P2 | ✅ | ✅ | | [frame-focusable-content](https://dequeuniversity.com/rules/axe/4.7/frame-focusable-content) | Ensures <frame> and <iframe> elements with focusable content do not have tabindex=-1 | 2.1.1 | A | P1 | ✅ | ✅ | | [frame-title](https://dequeuniversity.com/rules/axe/4.7/frame-title) | Ensures <iframe> and <frame> elements have an accessible name | 2.4.2 | A | P3 | ✅ | ✅ | -| [heading-order](https://dequeuniversity.com/rules/axe/4.7/heading-order) | Ensures the order of headings is semantically correct | 1.3.1 | A | P2 | ✅ | ✅ | | [html-has-lang](https://dequeuniversity.com/rules/axe/4.7/html-has-lang) | Ensures every HTML document has a lang attribute | 3.1.1 | A | P2 | ✅ | ✅ | | [html-lang-valid](https://dequeuniversity.com/rules/axe/4.7/html-lang-valid) | Ensures the lang attribute of the <html> element has a valid value | 3.1.1 | A | P2 | ✅ | ✅ | | [html-xml-lang-mismatch](https://dequeuniversity.com/rules/axe/4.7/html-xml-lang-mismatch) | Ensure that HTML elements with both valid lang and xml:lang attributes agree on the base language of the page | 3.1.1 | A | P2 | ✅ | ✅ | | [image-alt](https://dequeuniversity.com/rules/axe/4.7/image-alt) | Ensures <img> elements have alternate text or a role of none or presentation | 1.1.1 | A | P1 | ✅ | ✅ | -| [image-redundant-alt](https://dequeuniversity.com/rules/axe/4.7/image-redundant-alt) | Ensure image alternative is not repeated as text | 1.1.1 | A | P3 | ✅ | ✅ | | [input-button-name](https://dequeuniversity.com/rules/axe/4.7/input-button-name) | Ensures input buttons have discernible text | 4.1.2 | A | P1 | ✅ | ✅ | | [input-image-alt](https://dequeuniversity.com/rules/axe/4.7/input-image-alt) | Ensures <input type="image"> elements have alternate text | 1.1.1 | A | P1 | ✅ | ✅ | | [label](https://dequeuniversity.com/rules/axe/4.7/label) | Ensures every form element has a label | 3.3.2 | A | P1 | ✅ | ✅ | | [label-title-only](https://dequeuniversity.com/rules/axe/4.7/label-title-only) | Ensures that every form element has a visible label and is not solely labeled using hidden labels, or the title or aria-describedby attributes | 3.3.2 | A | P1 | ✅ | ✅ | -| [landmark-banner-is-top-level](https://dequeuniversity.com/rules/axe/4.7/landmark-banner-is-top-level) | Ensures the banner landmark is at top level | 4.1.1 | A | P3 | ✅ | ✅ | -| [landmark-complementary-is-top-level](https://dequeuniversity.com/rules/axe/4.7/landmark-complementary-is-top-level) | Ensures the complementary landmark or aside is at top level | 4.1.1 | A | P3 | ✅ | ✅ | -| [landmark-contentinfo-is-top-level](https://dequeuniversity.com/rules/axe/4.7/landmark-contentinfo-is-top-level) | Ensures the contentinfo landmark is at top level | 4.1.1 | A | P3 | ✅ | ✅ | -| [landmark-main-is-top-level](https://dequeuniversity.com/rules/axe/4.7/landmark-main-is-top-level) | Ensures the main landmark is at top level | 4.1.1 | A | P3 | ✅ | ✅ | -| [landmark-no-duplicate-banner](https://dequeuniversity.com/rules/axe/4.7/landmark-no-duplicate-banner) | Ensures the document has at most one banner landmark | 4.1.1 | A | P3 | ✅ | ✅ | -| [landmark-no-duplicate-contentinfo](https://dequeuniversity.com/rules/axe/4.7/landmark-no-duplicate-contentinfo) | Ensures the document has at most one contentinfo landmark | 4.1.1 | A | P3 | ✅ | ✅ | -| [landmark-no-duplicate-main](https://dequeuniversity.com/rules/axe/4.7/landmark-no-duplicate-main) | Ensures the document has at most one main landmark | 4.1.1 | A | P3 | ✅ | ✅ | -| [landmark-one-main](https://dequeuniversity.com/rules/axe/4.7/landmark-one-main) | Ensures the document has a main landmark | 4.1.1 | A | P3 | ✅ | ✅ | -| [landmark-unique](https://dequeuniversity.com/rules/axe/4.7/landmark-unique) | Landmarks should have a unique role or role/label/title (i.e. accessible name) combination | 4.1.1 | A | P3 | ✅ | ✅ | | [link-name](https://dequeuniversity.com/rules/axe/4.7/link-name) | Ensures links have discernible text | 4.1.2 | A | P1 | ✅ | ✅ | | [list](https://dequeuniversity.com/rules/axe/4.7/list) | Ensures that lists are structured correctly | 1.3.1 | A | P2 | ✅ | ✅ | | [listitem](https://dequeuniversity.com/rules/axe/4.7/listitem) | Ensures <li> elements are used semantically | 1.3.1 | A | P2 | ✅ | ✅ | | [marquee](https://dequeuniversity.com/rules/axe/4.7/marquee) | Ensures <marquee> elements are not used | 2.2.2 | A | P1 | ✅ | ✅ | | [meta-refresh](https://dequeuniversity.com/rules/axe/4.7/meta-refresh) | Ensures <meta http-equiv="refresh"> is not used for delayed refresh | 2.2.1 | A | P1 | ✅ | ✅ | | [meta-viewport](https://dequeuniversity.com/rules/axe/4.7/meta-viewport) | Ensures <meta name="viewport"> does not disable text scaling and zooming | 1.4.4 | AA | P2 | ✅ | ✅ | -| [meta-viewport-large](https://dequeuniversity.com/rules/axe/4.7/meta-viewport-large) | Ensures <meta name="viewport"> can scale a significant amount | 1.4.4 | AA | P2 | ✅ | ✅ | | [nested-interactive](https://dequeuniversity.com/rules/axe/4.7/nested-interactive) | Ensures interactive controls are not nested as they are not always announced by screen readers or can cause focus problems for assistive technologies | 4.1.2 | A | P1 | ✅ | ✅ | | [object-alt](https://dequeuniversity.com/rules/axe/4.7/object-alt) | Ensures <object> elements have alternate text | 1.1.1 | A | P1 | ✅ | ✅ | -| [page-has-heading-one](https://dequeuniversity.com/rules/axe/4.7/page-has-heading-one) | Ensure that the page, or at least one of its frames contains a level-one heading | 1.3.1 | A | P2 | ✅ | ✅ | | [presentation-role-conflict](https://dequeuniversity.com/rules/axe/4.7/presentation-role-conflict) | Elements marked as presentational should not have global ARIA or tabindex to ensure all screen readers ignore them | 4.1.1 | A | P3 | ✅ | ✅ | | [role-img-alt](https://dequeuniversity.com/rules/axe/4.7/role-img-alt) | Ensures [role='img'] elements have alternate text | 1.1.1 | A | P1 | ✅ | ✅ | | [scope-attr-valid](https://dequeuniversity.com/rules/axe/4.7/scope-attr-valid) | Ensures the scope attribute is used correctly on tables | 1.3.1 | A | P1 | ✅ | ✅ | @@ -118,17 +101,34 @@ console.log(a11yResults); | [th-has-data-cells](https://dequeuniversity.com/rules/axe/4.7/th-has-data-cells) | Ensure that <th> elements and elements with role=columnheader/rowheader have data cells they describe | 1.3.1 | A | P1 | ✅ | ✅ | | [valid-lang](https://dequeuniversity.com/rules/axe/4.7/valid-lang) | Ensures lang attributes have valid values | 3.1.1 | A | P2 | ✅ | ✅ | | [video-caption](https://dequeuniversity.com/rules/axe/4.7/video-caption) | Ensures <video> elements have captions | 1.2.2 | A | P1 | ✅ | ✅ | +| [accesskeys](https://dequeuniversity.com/rules/axe/4.7/accesskeys) | Ensures every accesskey attribute value is unique | 4.1.1 | A | P3 | ✖️ | ✅ | +| [aria-text](https://dequeuniversity.com/rules/axe/4.7/aria-text) | Ensures "role=text" is used on elements with no focusable descendants | 4.1.1 | A | P3 | ✖️ | ✅ | | [color-contrast-enhanced](https://dequeuniversity.com/rules/axe/4.7/color-contrast-enhanced) | Ensures the contrast between foreground and background colors meets WCAG 2 AAA enhanced contrast ratio thresholds | 1.4.6 | AAA | P3 | ✖️ | ✅ | | [css-orientation-lock](https://dequeuniversity.com/rules/axe/4.7/css-orientation-lock) | Ensures content is not locked to any specific display orientation, and the content is operable in all display orientations | 1.3.4 | AA | P3 | ✖️ | ✅ | +| [empty-heading](https://dequeuniversity.com/rules/axe/4.7/empty-heading) | Ensures headings have discernible text | 1.3.1 | A | P2 | ✖️ | ✅ | +| [empty-table-header](https://dequeuniversity.com/rules/axe/4.7/empty-table-header) | Ensures table headers have discernible text | 1.3.1 | A | P2 | ✖️ | ✅ | | [focus-order-semantics](https://dequeuniversity.com/rules/axe/4.7/focus-order-semantics) | Ensures elements in the focus order have a role appropriate for interactive content | | | P3 | ✖️ | ✅ | | [frame-tested](https://dequeuniversity.com/rules/axe/4.7/frame-tested) | Ensures <iframe> and <frame> elements contain the axe-core script | | | P3 | ✖️ | ✅ | | [frame-title-unique](https://dequeuniversity.com/rules/axe/4.7/frame-title-unique) | Ensures <iframe> and <frame> elements contain a unique title attribute | | | P3 | ✖️ | ✅ | +| [heading-order](https://dequeuniversity.com/rules/axe/4.7/heading-order) | Ensures the order of headings is semantically correct | 1.3.1 | A | P2 | ✖️ | ✅ | | [hidden-content](https://dequeuniversity.com/rules/axe/4.7/hidden-content) | Informs users about hidden content. | | | P3 | ✖️ | ✅ | | [identical-links-same-purpose](https://dequeuniversity.com/rules/axe/4.7/identical-links-same-purpose) | Ensure that links with the same accessible name serve a similar purpose | 2.4.9 | AAA | P3 | ✖️ | ✅ | +| [image-redundant-alt](https://dequeuniversity.com/rules/axe/4.7/image-redundant-alt) | Ensure image alternative is not repeated as text | 1.1.1 | A | P3 | ✖️ | ✅ | | [label-content-name-mismatch](https://dequeuniversity.com/rules/axe/4.7/label-content-name-mismatch) | Ensures that elements labelled through their content must have their visible text as part of their accessible name | 2.5.3 | A | P2 | ✖️ | ✅ | +| [landmark-banner-is-top-level](https://dequeuniversity.com/rules/axe/4.7/landmark-banner-is-top-level) | Ensures the banner landmark is at top level | 4.1.1 | A | P3 | ✖️ | ✅ | +| [landmark-complementary-is-top-level](https://dequeuniversity.com/rules/axe/4.7/landmark-complementary-is-top-level) | Ensures the complementary landmark or aside is at top level | 4.1.1 | A | P3 | ✖️ | ✅ | +| [landmark-contentinfo-is-top-level](https://dequeuniversity.com/rules/axe/4.7/landmark-contentinfo-is-top-level) | Ensures the contentinfo landmark is at top level | 4.1.1 | A | P3 | ✖️ | ✅ | +| [landmark-main-is-top-level](https://dequeuniversity.com/rules/axe/4.7/landmark-main-is-top-level) | Ensures the main landmark is at top level | 4.1.1 | A | P3 | ✖️ | ✅ | +| [landmark-no-duplicate-banner](https://dequeuniversity.com/rules/axe/4.7/landmark-no-duplicate-banner) | Ensures the document has at most one banner landmark | 4.1.1 | A | P3 | ✖️ | ✅ | +| [landmark-no-duplicate-contentinfo](https://dequeuniversity.com/rules/axe/4.7/landmark-no-duplicate-contentinfo) | Ensures the document has at most one contentinfo landmark | 4.1.1 | A | P3 | ✖️ | ✅ | +| [landmark-no-duplicate-main](https://dequeuniversity.com/rules/axe/4.7/landmark-no-duplicate-main) | Ensures the document has at most one main landmark | 4.1.1 | A | P3 | ✖️ | ✅ | +| [landmark-one-main](https://dequeuniversity.com/rules/axe/4.7/landmark-one-main) | Ensures the document has a main landmark | 4.1.1 | A | P3 | ✖️ | ✅ | +| [landmark-unique](https://dequeuniversity.com/rules/axe/4.7/landmark-unique) | Landmarks should have a unique role or role/label/title (i.e. accessible name) combination | 4.1.1 | A | P3 | ✖️ | ✅ | | [link-in-text-block](https://dequeuniversity.com/rules/axe/4.7/link-in-text-block) | Ensure links are distinguished from surrounding text in a way that does not rely on color | 1.4.1 | A | P1 | ✖️ | ✅ | | [meta-refresh-no-exceptions](https://dequeuniversity.com/rules/axe/4.7/meta-refresh-no-exceptions) | Ensures <meta http-equiv="refresh"> is not used for delayed refresh | | | P3 | ✖️ | ✅ | +| [meta-viewport-large](https://dequeuniversity.com/rules/axe/4.7/meta-viewport-large) | Ensures <meta name="viewport"> can scale a significant amount | 1.4.4 | AA | P2 | ✖️ | ✅ | | [no-autoplay-audio](https://dequeuniversity.com/rules/axe/4.7/no-autoplay-audio) | Ensures <video> or <audio> elements do not autoplay audio for more than 3 seconds without a control mechanism to stop or mute the audio | 1.4.2 | A | P1 | ✖️ | ✅ | +| [page-has-heading-one](https://dequeuniversity.com/rules/axe/4.7/page-has-heading-one) | Ensure that the page, or at least one of its frames contains a level-one heading | 1.3.1 | A | P2 | ✖️ | ✅ | | [p-as-heading](https://dequeuniversity.com/rules/axe/4.7/p-as-heading) | Ensure bold, italic text and font-size is not used to style <p> elements as a heading | 1.3.1 | A | P2 | ✖️ | ✅ | | [region](https://dequeuniversity.com/rules/axe/4.7/region) | Ensures all page content is contained by landmarks | | | P3 | ✖️ | ✅ | | [skip-link](https://dequeuniversity.com/rules/axe/4.7/skip-link) | Ensure all skip links have a focusable target | | | P3 | ✖️ | ✅ | diff --git a/packages/preset-rules/__tests__/wcag.test.ts b/packages/preset-rules/__tests__/wcag.test.ts index d5a1a6b4..870fe43b 100644 --- a/packages/preset-rules/__tests__/wcag.test.ts +++ b/packages/preset-rules/__tests__/wcag.test.ts @@ -46,7 +46,7 @@ describe('WCAG Metadata extractor', () => { ); it.each([ - 'accesskeys', // base rule + 'area-alt', // base rule 'table-duplicate-name', // extended rule without WCAG SC ])('should populate WCAG metadata as expected for rule (arg:%p)', (ruleID) => { const wcag = new WcagMetadata({ id: ruleID, tags: [] } as Result); diff --git a/packages/preset-rules/src/base.ts b/packages/preset-rules/src/base.ts index 3a2c4333..8c4c0986 100644 --- a/packages/preset-rules/src/base.ts +++ b/packages/preset-rules/src/base.ts @@ -9,7 +9,6 @@ import { getA11yConfig, RuleInfo } from './rules'; export const baseRulesInfo: RuleInfo = new Map( Object.entries({ - 'accesskeys': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, 'area-alt': { priority: 'P1', wcagSC: '1.1.1', wcagLevel: 'A' }, 'aria-allowed-attr': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, 'aria-allowed-role': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, @@ -25,7 +24,6 @@ export const baseRulesInfo: RuleInfo = new Map( 'aria-required-parent': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, 'aria-roledescription': { priority: 'P3', wcagSC: '4.1.2', wcagLevel: 'A' }, 'aria-roles': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, - 'aria-text': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, 'aria-toggle-field-name': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, 'aria-tooltip-name': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, 'aria-treeitem-name': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, @@ -44,40 +42,25 @@ export const baseRulesInfo: RuleInfo = new Map( 'duplicate-id': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, 'duplicate-id-active': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, 'duplicate-id-aria': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, - 'empty-heading': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, - 'empty-table-header': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'form-field-multiple-labels': { priority: 'P2', wcagSC: '2.5.3', wcagLevel: 'A' }, 'frame-focusable-content': { priority: 'P1', wcagSC: '2.1.1', wcagLevel: 'A' }, 'frame-title': { priority: 'P3', wcagSC: '2.4.2', wcagLevel: 'A' }, - 'heading-order': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'html-has-lang': { priority: 'P2', wcagSC: '3.1.1', wcagLevel: 'A' }, 'html-lang-valid': { priority: 'P2', wcagSC: '3.1.1', wcagLevel: 'A' }, 'html-xml-lang-mismatch': { priority: 'P2', wcagSC: '3.1.1', wcagLevel: 'A' }, 'image-alt': { priority: 'P1', wcagSC: '1.1.1', wcagLevel: 'A' }, - 'image-redundant-alt': { priority: 'P3', wcagSC: '1.1.1', wcagLevel: 'A' }, 'input-button-name': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, 'input-image-alt': { priority: 'P1', wcagSC: '1.1.1', wcagLevel: 'A' }, 'label': { priority: 'P1', wcagSC: '3.3.2', wcagLevel: 'A' }, 'label-title-only': { priority: 'P1', wcagSC: '3.3.2', wcagLevel: 'A' }, - 'landmark-banner-is-top-level': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, - 'landmark-complementary-is-top-level': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, - 'landmark-contentinfo-is-top-level': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, - 'landmark-main-is-top-level': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, - 'landmark-no-duplicate-banner': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, - 'landmark-no-duplicate-contentinfo': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, - 'landmark-no-duplicate-main': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, - 'landmark-one-main': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, - 'landmark-unique': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, 'link-name': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, 'list': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'listitem': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'marquee': { priority: 'P1', wcagSC: '2.2.2', wcagLevel: 'A' }, 'meta-refresh': { priority: 'P1', wcagSC: '2.2.1', wcagLevel: 'A' }, 'meta-viewport': { priority: 'P2', wcagSC: '1.4.4', wcagLevel: 'AA' }, - 'meta-viewport-large': { priority: 'P2', wcagSC: '1.4.4', wcagLevel: 'AA' }, 'nested-interactive': { priority: 'P1', wcagSC: '4.1.2', wcagLevel: 'A' }, 'object-alt': { priority: 'P1', wcagSC: '1.1.1', wcagLevel: 'A' }, - 'page-has-heading-one': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'presentation-role-conflict': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, 'role-img-alt': { priority: 'P1', wcagSC: '1.1.1', wcagLevel: 'A' }, 'scope-attr-valid': { priority: 'P1', wcagSC: '1.3.1', wcagLevel: 'A' }, diff --git a/packages/preset-rules/src/extended.ts b/packages/preset-rules/src/extended.ts index 4cdd6f1c..78fbd846 100644 --- a/packages/preset-rules/src/extended.ts +++ b/packages/preset-rules/src/extended.ts @@ -12,17 +12,34 @@ export const extendedRulesInfo: RuleInfo = new Map([ ...baseRulesInfo, ...(new Map( Object.entries({ + 'accesskeys': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'aria-text': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, 'color-contrast-enhanced': { priority: 'P3', wcagSC: '1.4.6', wcagLevel: 'AAA' }, 'css-orientation-lock': { priority: 'P3', wcagSC: '1.3.4', wcagLevel: 'AA' }, + 'empty-heading': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, + 'empty-table-header': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'focus-order-semantics': { priority: 'P3', wcagSC: '', wcagLevel: '' }, 'frame-tested': { priority: 'P3', wcagSC: '', wcagLevel: '' }, 'frame-title-unique': { priority: 'P3', wcagSC: '', wcagLevel: '' }, + 'heading-order': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'hidden-content': { priority: 'P3', wcagSC: '', wcagLevel: '' }, 'identical-links-same-purpose': { priority: 'P3', wcagSC: '2.4.9', wcagLevel: 'AAA' }, + 'image-redundant-alt': { priority: 'P3', wcagSC: '1.1.1', wcagLevel: 'A' }, 'label-content-name-mismatch': { priority: 'P2', wcagSC: '2.5.3', wcagLevel: 'A' }, + 'landmark-banner-is-top-level': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'landmark-complementary-is-top-level': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'landmark-contentinfo-is-top-level': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'landmark-main-is-top-level': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'landmark-no-duplicate-banner': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'landmark-no-duplicate-contentinfo': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'landmark-no-duplicate-main': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'landmark-one-main': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, + 'landmark-unique': { priority: 'P3', wcagSC: '4.1.1', wcagLevel: 'A' }, 'link-in-text-block': { priority: 'P1', wcagSC: '1.4.1', wcagLevel: 'A' }, 'meta-refresh-no-exceptions': { priority: 'P3', wcagSC: '', wcagLevel: '' }, + 'meta-viewport-large': { priority: 'P2', wcagSC: '1.4.4', wcagLevel: 'AA' }, 'no-autoplay-audio': { priority: 'P1', wcagSC: '1.4.2', wcagLevel: 'A' }, + 'page-has-heading-one': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'p-as-heading': { priority: 'P2', wcagSC: '1.3.1', wcagLevel: 'A' }, 'region': { priority: 'P3', wcagSC: '', wcagLevel: '' }, 'skip-link': { priority: 'P3', wcagSC: '', wcagLevel: '' },