Skip to content

Commit

Permalink
docs(attr-whitespace): initial documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
nschonni committed Jan 23, 2022
1 parent 65ac9e5 commit dac2bf3
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions docs/user-guide/list-rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ title: List of rules
- [`attr-unsafe-chars`](/docs/user-guide/rules/attr-unsafe-chars): Attribute values cannot contain unsafe chars.
- [`attr-value-double-quotes`](/docs/user-guide/rules/attr-value-double-quotes): Attribute values must be in double quotes.
- [`attr-value-not-empty`](/docs/user-guide/rules/attr-value-not-empty): All attributes must have values.
- [`attr-whitespace`](/docs/user-guide/rules/attr-whitespace): No leading or trailing spaces in attribute values.
- [`alt-require`](/docs/user-guide/rules/alt-require): The alt attribute of an element must be present and alt attribute of area[href] and input[type=image] must have a value.
- [`input-requires-label`](/docs/user-guide/rules/input-requires-label): All [ input ] tags must have a corresponding [ label ] tag.

Expand Down
29 changes: 29 additions & 0 deletions docs/user-guide/rules/attr-whitespace.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
id: attr-whitespace
title: attr-whitespace
---

No leading or trailing spaces inside attribute values.

Level: `error`

## Config value

1. true: enable rule
2. false: disable rule

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

<!-- prettier-ignore -->
```html
<div title="a"></div>
```

The following pattern is considered violation:

<!-- prettier-ignore -->
```html
<div title=" a"></div>
<div title="a "></div>
<div title =" a "></div>
```

0 comments on commit dac2bf3

Please sign in to comment.