Skip to content

Commit

Permalink
docs: explained rule fixers and suggestions (#17657)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
JoshuaKGoldberg and nzakas committed Oct 24, 2023
1 parent db06a7f commit 3aec1c5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion docs/src/_includes/components/rule-categories.macro.html
Expand Up @@ -21,7 +21,7 @@
<div class="rule-category">
<span class="rule-category__icon">💡 <span class="visually-hidden">hasSuggestions</span></span>
<p class="rule-category__description">
Some problems reported by this rule are manually fixable by editor <a href="../extend/custom-rules#providing-suggestions">suggestions</a>
Some problems reported by this rule are manually fixable by editor <a href="../use/core-concepts#rule-suggestions">suggestions</a>
</p>
</div>
{%- endif -%}
Expand Down
17 changes: 17 additions & 0 deletions docs/src/use/core-concepts.md
Expand Up @@ -23,6 +23,23 @@ ESLint contains hundreds of built-in rules that you can use. You can also create

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

### Rule Fixes

Rules may optionally provide fixes for violations that they find. Fixes safely correct the violation without changing application logic.

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.

Rules that may provide fixes are marked with 🔧 in [Rules](../rules/).

### Rule Suggestions

Rules may optionally provide suggestions in addition to or instead of providing fixes. Suggestions differ from fixes in two ways:

1. Suggestions may change application logic and so cannot be automatically applied.
1. Suggestions cannot be applied through the ESLint CLI and are only available through editor integrations.

Rules that may provide suggestions are marked with 💡 in [Rules](../rules/).

## Configuration Files

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.
Expand Down

0 comments on commit 3aec1c5

Please sign in to comment.