Skip to content

Commit

Permalink
docs: user-guide rules updates (#650)
Browse files Browse the repository at this point in the history
* Update descriptions in space-tab-mixed-disabled.md

Update grammar and readability.
Add Example

* add attr-lowercase example

* Update alt-require doc
  • Loading branch information
bcdady authored Jun 8, 2021
1 parent fa053d6 commit a68bf8f
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 14 deletions.
8 changes: 4 additions & 4 deletions docs/user-guide/rules/alt-require.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ title: alt-require
keywords:
- alt
- image
- accessiblity
- accessibility
---

Alt of img must be present and alt of area[href] and input[type=image] must be set value.
Alt of `img` must be present and alt of area[href] and input[type=image] must be set with a value.

Level: warning

Expand All @@ -16,7 +16,7 @@ Level: warning
1. true: enable rule
2. false: disable rule

The following pattern are **not** considered violations:
The following pattern are **not** considered rule violations:

<!-- prettier-ignore -->
```html
Expand All @@ -25,7 +25,7 @@ The following pattern are **not** considered violations:
<area shape="circle" coords="180,139,14" href="test.html" alt="test" />
```

The following pattern is considered violation:
The following pattern is considered a rule violation:

<!-- prettier-ignore -->
```html
Expand Down
14 changes: 12 additions & 2 deletions docs/user-guide/rules/attr-lowercase.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,24 @@ Level: `error`
2. false: disable rule
3. ['viewBox', 'Test']: enable rule except for the given attribute names

The following pattern is **not** considered a violation:
### Example

```json
{
...
"attr-lowercase": ['viewBox']
...
}
```

The following pattern is **not** considered a rule violation:

<!-- prettier-ignore -->
```html
<img src="test.png" alt="test" />
```

The following pattern is considered a violation:
The following pattern is considered a rule violation:

<!-- prettier-ignore -->
```html
Expand Down
26 changes: 18 additions & 8 deletions docs/user-guide/rules/space-tab-mixed-disabled.md
Original file line number Diff line number Diff line change
@@ -1,28 +1,38 @@
---
id: space-tab-mixed-disabled
title: space-tab-mixed-disabled
title: space-tab-mixed-disabled # consider renaming to blankspace
---

Spaces and tabs can not mixed in front of line.
Blank-space (space and tab) characters should not be mixed in the beginning of any line.

Level: `warning`

## Config value
## Config values

1. space: space mode (only space for indentation)
2. space4: space mode and require length
3. tab: tab mode (only tab for indentation)
1. space: space mode (only spaces are valid for indentation)
2. space4: space mode and require 4 space characters
3. tab: tab mode (only tab characters are valid for indentation)
4. false: disable rule

The following pattern are **not** considered violations:
### Example

```json
{
...
"space-tab-mixed-disabled": space4
...
}
```

The following patterns are **not** considered rule violations:

<!-- prettier-ignore -->
```html
→ →<img src="tab.png" />
········<img src="space.png" />
```

The following pattern is considered violation:
The following pattern is considered a rule violation:

<!-- prettier-ignore -->
```html
Expand Down

0 comments on commit a68bf8f

Please sign in to comment.