Skip to content

Commit

Permalink
feat(preset-wcag): Add some rules to recommended set
Browse files Browse the repository at this point in the history
  • Loading branch information
wadackel committed Dec 14, 2020
1 parent 0a824ed commit 6bafccc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions packages/acot-preset-wcag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,14 @@ You can also enable all the recommended rules for our preset. Add `preset:@acot/

| Name | Summary | :heavy_check_mark: |
| :-------------------------------------------------------------------------------------- | :------------------------------------------------------------------------- | :----------------- |
| [`@acot/wcag/dialog-focus`](./docs/rules/dialog-focus.md) | Move focus to inside dialog or set dialog after trigger. | :heavy_check_mark: |
| [`@acot/wcag/focusable-has-indicator`](./docs/rules/focusable-has-indicator.md) | Focusable elemenet has a focus indicator. | :heavy_check_mark: |
| [`@acot/wcag/img-has-name`](./docs/rules/img-has-name.md) | The `img` element or img role MUST has name. | :heavy_check_mark: |
| [`@acot/wcag/interactive-has-enough-size`](./docs/rules/interactive-has-enough-size.md) | The size of the target for pointer inputs is at least 44 by 44 CSS pixels. | :heavy_check_mark: |
| [`@acot/wcag/interactive-has-name`](./docs/rules/interactive-has-name.md) | Interactive elements MUST has name. | :heavy_check_mark: |
| [`@acot/wcag/interactive-supports-focus`](./docs/rules/interactive-supports-focus.md) | _T.B.A_ | :heavy_check_mark: |
| [`@acot/wcag/page-has-title`](./docs/rules/page-has-title.md) | Web pages have titles that describe topic or purpose. WCAG 2.1 - 2.4.2. | :heavy_check_mark: |
| [`@acot/wcag/page-has-valid-lang`](./docs/rules/page-has-valid-lang.md) | The `html` element MUST has a valid lang attribute. | :heavy_check_mark: |

<!-- acot-rules:end -->

Expand Down
6 changes: 5 additions & 1 deletion packages/acot-preset-wcag/src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,14 @@ import type { Config } from '@acot/types';
const config: Config = {
extends: ['./configs/base'],
rules: {
'@acot/wcag/dialog-focus': 'error',
'@acot/wcag/focusable-has-indicator': 'error',
'@acot/wcag/img-has-name': 'error',
'@acot/wcag/interactive-has-enough-size': 'warn',
'@acot/wcag/interactive-has-name': 'error',
'@acot/wcag/interactive-supports-focus': 'error',
'@acot/wcag/interactive-has-enough-size': 'error',
'@acot/wcag/page-has-title': 'error',
'@acot/wcag/page-has-valid-lang': 'error',
},
};

Expand Down

0 comments on commit 6bafccc

Please sign in to comment.