Skip to content

Commit dac2bf3

Browse files
committed
docs(attr-whitespace): initial documentation
1 parent 65ac9e5 commit dac2bf3

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed

docs/user-guide/list-rules.md

+1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ title: List of rules
2323
- [`attr-unsafe-chars`](/docs/user-guide/rules/attr-unsafe-chars): Attribute values cannot contain unsafe chars.
2424
- [`attr-value-double-quotes`](/docs/user-guide/rules/attr-value-double-quotes): Attribute values must be in double quotes.
2525
- [`attr-value-not-empty`](/docs/user-guide/rules/attr-value-not-empty): All attributes must have values.
26+
- [`attr-whitespace`](/docs/user-guide/rules/attr-whitespace): No leading or trailing spaces in attribute values.
2627
- [`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.
2728
- [`input-requires-label`](/docs/user-guide/rules/input-requires-label): All [ input ] tags must have a corresponding [ label ] tag.
2829

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
id: attr-whitespace
3+
title: attr-whitespace
4+
---
5+
6+
No leading or trailing spaces inside attribute values.
7+
8+
Level: `error`
9+
10+
## Config value
11+
12+
1. true: enable rule
13+
2. false: disable rule
14+
15+
The following pattern are **not** considered violations:
16+
17+
<!-- prettier-ignore -->
18+
```html
19+
<div title="a"></div>
20+
```
21+
22+
The following pattern is considered violation:
23+
24+
<!-- prettier-ignore -->
25+
```html
26+
<div title=" a"></div>
27+
<div title="a "></div>
28+
<div title =" a "></div>
29+
```

0 commit comments

Comments
 (0)