ESLint Docs Components

Components used across this site.

Rule categories

Rule categories

The rule categories—namely “recommended”, “fixable”, and “hasSuggestions”—are shown in the rules page. They are rendered using the ruleCategories macro (imported from /components/rule-categories.macro.html). There is also an individual macro for each category type.

{ % from 'components/rule-categories.macro.html' import ruleCategories % }

{ { ruleCategories({
        recommended: true,
        fixable: true,
        hasSuggestions: true
}) } }

Example

Recommended

Using the recommended config from @eslint/js in a configuration file enables this rule

🔧 Fixable

Some problems reported by this rule are automatically fixable by the --fix command line option

💡 hasSuggestions

Some problems reported by this rule are manually fixable by editor suggestions

A rule category

For every rule, you can render the category it belongs to using the corresponding category shortcode:

{ % recommended % }
{ % fixable % }
{ % hasSuggestions % }

Examples

Recommended

if the “extends”: “eslint:recommended” property in a configuration file enables the rule.

🔧 Fixable

if some problems reported by the rule are automatically fixable by the –fix command line option

💡 hasSuggestions

if some problems reported by the rule are manually fixable by editor suggestions