ESLint Docs Components

Components used across this site.

Rule

The rule component is a macro defined in /components/rule.macro.html. The macro accepts a set of parameters used to render the rule.

A rule has a:

  • name
  • description
  • a flag to indicate whether it’s deprecated or removed: deprecated and removed respectively
  • a replacedBy value indicating the rule it has been replaced with (if applicable)
  • a categories object indicating the rule’s category

Usage

<!-- import the macro -->
{ % from 'components/rule.macro.html' import rule % }

<!-- use the macro -->
{ { rule({
name: "rule-name",
deprecated: true, // or removed: true
replacedBy: "name-of-replacement-rule"
description: 'Example: Enforce `return` statements in getters.',
categories: {
recommended: true,
fixable: true,
hasSuggestions: false
}
}) } }

Examples

getter-return deprecated

Enforce `return` statements in getters.

Categories:

πŸ›  Fix

getter-return removed

Replaced by other-rule-here

Categories:

πŸ›  Fix

getter-return

Enforce `return` statements in getters.

Categories:

βœ… Extends