Skip to content

Commit

Permalink
Merge pull request #231 from acot-a11y/feat/invalid-id-reference
Browse files Browse the repository at this point in the history
Add `invalid-id-reference` rule
  • Loading branch information
wadackel authored Jun 5, 2022
2 parents c060a8c + 2a70d7e commit a7eb3b0
Show file tree
Hide file tree
Showing 7 changed files with 513 additions and 34 deletions.
15 changes: 9 additions & 6 deletions packages/acot-preset-wcag/.scaffdog/01-rule.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
---
name: 'rule'
description: 'Generate a rule.'
message: 'Please enter the rule name.'
root: '.'
output: '.'
ignore: ['**/*']
questions:
name: 'Please enter the rule name.'
---

# `docs/rules/{{ input }}.md`
# Variables

- name: `{{ inputs.name | kebab }}`

# `docs/rules/{{ name }}.md`

````markdown
# {{ input }}
# {{ name }}

**TODO:** Short summary.

Expand All @@ -29,7 +32,7 @@ ignore: ['**/*']
```
````

# `src/rules/{{ input }}.ts`
# `src/rules/{{ name }}.ts`

```typescript
import { createRule } from '@acot/core';
Expand Down
3 changes: 3 additions & 0 deletions packages/acot-preset-wcag/.scaffdog/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
files: ['./*'],
};
57 changes: 29 additions & 28 deletions packages/acot-preset-wcag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,18 @@ You can also enable all the recommended rules for our preset. Add `preset:@acot/

<!-- acot-rules:start -->

| 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 element 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_ | |
| [`@acot/wcag/link-has-name`](./docs/rules/link-has-name.md) | Link MUST has name. | :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: |
| 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 element 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_ | |
| [`@acot/wcag/invalid-id-reference`](./docs/rules/invalid-id-reference.md) | The target of the ID reference or ID reference list MUST exist in the same document. | :heavy_check_mark: |
| [`@acot/wcag/link-has-name`](./docs/rules/link-has-name.md) | Link MUST has name. | :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 All @@ -55,9 +56,9 @@ You can also enable all the recommended rules for our preset. Add `preset:@acot/

#### 1.1 Text Alternatives

| Success criteria | acot rules |
| ---------------------- | ------------------------------------------------------- |
| 1.1.1 Non-text Content | [@acot/wcag/img-has-name](./docs/rules/img-has-name.md) |
| Success criteria | acot rules |
| ---------------------- | ---------- |
| 1.1.1 Non-text Content | - |

#### 1.2 Time-based Media

Expand All @@ -75,14 +76,14 @@ You can also enable all the recommended rules for our preset. Add `preset:@acot/

#### 1.3 Adaptable

| Success criteria | acot rules |
| ----------------------------- | ---------- |
| 1.3.1 Info and Relationships | - |
| 1.3.2 Meaningful Sequence | - |
| 1.3.3 Sensory Characteristics | - |
| 1.3.4 Orientation | - |
| 1.3.5 Identify Input Purpose | - |
| 1.3.6 Identify Purpose | - |
| Success criteria | acot rules |
| ----------------------------- | ----------------------------------------------------------------------- |
| 1.3.1 Info and Relationships | [@acot/wcag/invalid-id-reference](./docs/rules/invalid-id-reference.md) |
| 1.3.2 Meaningful Sequence | - |
| 1.3.3 Sensory Characteristics | - |
| 1.3.4 Orientation | - |
| 1.3.5 Identify Input Purpose | - |
| 1.3.6 Identify Purpose | - |

#### 1.4 Distinguishable

Expand Down Expand Up @@ -139,7 +140,7 @@ You can also enable all the recommended rules for our preset. Add `preset:@acot/
| 2.4.1 Bypass Blocks | - |
| 2.4.2 Page Titled | [@acot/wcag/page-has-title](./docs/rules/page-has-title.md) |
| 2.4.3 Focus Order | [@acot/wcag/dialog-focus](./docs/rules/dialog-focus.md) |
| 2.4.4 Link Purpose (In Context) | [@acot/wcag/link-has-name](./docs/rules/link-has-name.md)- |
| 2.4.4 Link Purpose (In Context) | [@acot/wcag/link-has-name](./docs/rules/link-has-name.md) |
| 2.4.5 Multiple Ways | - |
| 2.4.6 Headings and Labels | - |
| 2.4.7 Focus Visible | [@acot/wcag/focusable-has-indicator](./docs/rules/focusable-has-indicator.md) |
Expand Down Expand Up @@ -196,11 +197,11 @@ You can also enable all the recommended rules for our preset. Add `preset:@acot/

#### 4.1 Compatible

| Success criteria | acot rules |
| ----------------------- | --------------------------------------------------------- |
| 4.1.1 Parsing | - |
| 4.1.2 Name, Role, Value | [@acot/wcag/link-has-name](./docs/rules/link-has-name.md) |
| 4.1.3 Status Messages | - |
| Success criteria | acot rules |
| ----------------------- | ----------------------------------------------------------------------- |
| 4.1.1 Parsing | [@acot/wcag/invalid-id-reference](./docs/rules/invalid-id-reference.md) |
| 4.1.2 Name, Role, Value | [@acot/wcag/link-has-name](./docs/rules/link-has-name.md) |
| 4.1.3 Status Messages | - |

## Concept

Expand Down
Loading

0 comments on commit a7eb3b0

Please sign in to comment.