---
title: Rules
layout: doc
---

<p>Rules in ESLint are grouped by type to help you understand their purpose. Each rule has emojis denoting:</p>
<p>(recommended) if the <code>"extends": "eslint:recommended"</code> property in a <a href="../user-guide/configuring#extending-configuration-files">configuration file</a> enables the rule</p>
<p>(fixable) if some problems reported by the rule are automatically fixable by the <code>--fix</code> <a href="../user-guide/command-line-interface#--fix">command line</a> option</p>
<p>(hasSuggestions) if some problems reported by the rule are manually fixable by editor <a href="../developer-guide/working-with-rules#providing-suggestions">suggestions</a></p>
{% for type in rules.types %}
  <h2>{{ type.displayName }}</h2>
  {{ type.description }}
  <table class="rule-list table table-striped">
    <colgroup>
      <col class="recommended" />
      <col class="fixable" />
      <col class="hasSuggestions" />
      <col class="name" />
      <col class="description" />
    </colgroup>
    <tbody>
      {% for rule in type.rules %}
        <tr>
        <td>{% if rule.recommended %}(recommended){% endif %}</td>
        <td>{% if rule.fixable %}(fixable){% endif %}</td>
        <td>{% if rule.hasSuggestions %}(hasSuggestions){% 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>
