This repository has been archived by the owner on Nov 10, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 245
/
index.liquid
110 lines (109 loc) · 3.74 KB
/
index.liquid
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
---
title: List of available rules
layout: doc
---
<h1>Rules</h1>
<p>Rules in ESLint are grouped by category to help you understand their purpose.</p>
<p>No rules are enabled by default. The <code>"extends": "eslint:recommended"</code> property in a <a href="../user-guide/configuring#extending-configuration-files">configuration file</a> enables rules that report common problems, which have a check mark (recommended) below.</p>
<p>The `--fix` option on the <a href="../user-guide/command-line-interface#fix">command line</a> automatically fixes problems (currently mostly whitespace) reported by rules which have a wrench (fixable) below.</p>
{% for category in rules.categories %}
<h2>{{ category.name }}</h2>
{{ category.description }}
<table class="rule-list table table-striped">
<colgroup>
<col class="recommended" />
<col class="fixable" />
<col class="name" />
<col class="description" />
</colgroup>
<tbody>
{% for rule in category.rules %}
<tr>
<td>{% if rule.recommended %}(recommended){% endif %}</td>
<td>{% if rule.fixable %}(fixable){% endif %}</td>
<td markdown="1"><a href="{{ rule.name }}">{{ rule.name }}</a> </td>
<td markdown="1">{{ rule.description }} </td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
{% if rules.deprecated %}
<h2>{{ rules.deprecated.name }}</h2>
{{ rules.deprecated.description }}
<div class="rule-list deprecated-rules">
<table class="table table-striped">
<colgroup>
<col class="name" />
<col class="replaced-by" />
</colgroup>
<thead>
<tr>
<th>Deprecated rule</th>
<th>Replaced by</th>
</tr>
</thead>
<tbody>
{% for rule in rules.deprecated.rules %}
<tr>
<td markdown="1">
<a href="{{ rule.name }}">{{ rule.name }}</a>
</td>
<td class="replaced-by" markdown="1">
{% assign hasReplacement = false %}
{% if rule.replacedBy.size > 0 %}
{% for replaced in rule.replacedBy %}
{% comment %} Do not link to rule docs in 3rd party plugins. {% endcomment %}
{% assign ruleNameSegments = replaced | split: "/" %}
{% if ruleNameSegments.size == 1 %}
<a href="{{ replaced }}">{{ replaced }}</a>
{% assign hasReplacement = true %}
{% endif %}
{% endfor %}
{% endif %}
{% if hasReplacement == false %}
<p class="text-muted">(no replacement)</p>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endif %}
<h2>{{ rules.removed.name }}</h2>
{{ rules.removed.description }}
<div class="rule-list removed-rules">
<table class="table table-striped">
<colgroup>
<col class="name" />
<col class="replaced-by" />
</colgroup>
<thead>
<tr>
<th>Removed rule</th>
<th>Replaced by</th>
</tr>
</thead>
<tbody>
{% for rule in rules.removed.rules %}
<tr>
<td markdown="1">
<a href="{{ rule.removed }}">{{ rule.removed }}</a>
</td>
{% if rule.replacedBy.size > 0 %}
<td class="replaced-by" markdown="1">
{% for replaced in rule.replacedBy %}
<a href="{{ replaced }}">{{ replaced }}</a>
{% endfor %}
</td>
{% else %}
<td class="replaced-by" markdown="1">
<p class="text-muted">(no replacement)</p>
</td>
{% endif %}
</tr>
{% endfor %}
</tbody>
</table>
</div>