You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can enable, disable, and ignore rules using special comments. This is based on [remark-message-control](https://github.com/remarkjs/remark-message-control#markers).
44
+
45
+
By default, all rules are turned on. For example, 4 errors (2 of `no-dead-urls` and 2 of `awesome-list-item`) will be generated for following code snippets.
46
+
47
+
```md
48
+
- [foo](https://foo.com) - an invalid description.
49
+
- [foo](https://foo.com) - invalid description.
50
+
```
51
+
52
+
###### `disable`
53
+
54
+
The `disable` keyword turns off all messages of the given rule identifiers. If no identifiers are specified, all messages are turned off.
55
+
56
+
**Don't leave spaces after the last rule identifier.**
57
+
58
+
For example, only the 2 `no-dead-urls` errors are left:
59
+
60
+
```md
61
+
<!--lint disable awesome-list-item-->
62
+
- [foo](https://foo.com) - an invalid description.
63
+
- [foo](https://foo.com) - invalid description.
64
+
```
65
+
66
+
###### `enable`
67
+
68
+
The `enable` keyword turns on all messages of the given rule identifiers. If no identifiers are specified, all messages are turned on.
69
+
70
+
For example, only the second line reports a `awesome-list-item` rule violation:
71
+
72
+
```md
73
+
<!--lint disable awesome-list-item-->
74
+
- [foo](https://foo.com) - an invalid description.
75
+
<!--lint enable awesome-list-item-->
76
+
- [foo](https://foo.com) - invalid description.
77
+
```
78
+
79
+
###### `ignore`
80
+
81
+
The `ignore` keyword turns off all messages of the given rule identifiers occurring in the following node. If no identifiers are specified, all messages are turned ignored. After the end of the following node, messages are turned on again. This is the main difference with `disable`.
82
+
83
+
For example, to turn off certain messages for the next node:
84
+
85
+
```md
86
+
<!--lint ignore awesome-list-item-->
87
+
- [foo](https://foo.com) - an invalid description.
88
+
89
+
List items share the same parent node. So let's create a new list.
90
+
91
+
- [foo](https://foo.com) - invalid description.
92
+
```
93
+
41
94
### Tip
42
95
43
96
Add it as a `test` script in package.json and activate Travis CI to lint on new commits and pull requests.
0 commit comments