Skip to content

Commit 3aec1c5

Browse files
docs: explained rule fixers and suggestions (#17657)
* docs: explained report fixers and suggestions * Apply suggestions from code review Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com> * Post-suggestion fix: rule-categories.macro.html link --------- Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
1 parent db06a7f commit 3aec1c5

2 files changed

Lines changed: 18 additions & 1 deletion

File tree

docs/src/_includes/components/rule-categories.macro.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
<div class="rule-category">
2222
<span class="rule-category__icon">💡 <span class="visually-hidden">hasSuggestions</span></span>
2323
<p class="rule-category__description">
24-
Some problems reported by this rule are manually fixable by editor <a href="../extend/custom-rules#providing-suggestions">suggestions</a>
24+
Some problems reported by this rule are manually fixable by editor <a href="../use/core-concepts#rule-suggestions">suggestions</a>
2525
</p>
2626
</div>
2727
{%- endif -%}

docs/src/use/core-concepts.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,23 @@ ESLint contains hundreds of built-in rules that you can use. You can also create
2323

2424
For more information, refer to [Rules](../rules/).
2525

26+
### Rule Fixes
27+
28+
Rules may optionally provide fixes for violations that they find. Fixes safely correct the violation without changing application logic.
29+
30+
Fixes may be applied automatically with the [`--fix` command line option](https://eslint.org/docs/latest/use/command-line-interface#--fix) and via editor extensions.
31+
32+
Rules that may provide fixes are marked with 🔧 in [Rules](../rules/).
33+
34+
### Rule Suggestions
35+
36+
Rules may optionally provide suggestions in addition to or instead of providing fixes. Suggestions differ from fixes in two ways:
37+
38+
1. Suggestions may change application logic and so cannot be automatically applied.
39+
1. Suggestions cannot be applied through the ESLint CLI and are only available through editor integrations.
40+
41+
Rules that may provide suggestions are marked with 💡 in [Rules](../rules/).
42+
2643
## Configuration Files
2744

2845
An ESLint configuration file is a place where you put the configuration for ESLint in your project. You can include built-in rules, how you want them enforced, plugins with custom rules, shareable configurations, which files you want rules to apply to, and more.

0 commit comments

Comments
 (0)