Document which rules provide suggestions and improve consistency of rule autofixer notices #3359
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a documentation PR touching two areas.
Suggestions
The lightbulb 💡 emoji is the convention for denoting rules that provide editor suggestions. It's used by the official ESLint website as well as in the documentation of many popular ESLint plugins. Examples (note: I am a maintainer on some of these plugins and have been working to standardize the lists of rules):
My change adds this indicator to the README and as a notice in rule documentation files.
Currently, only one of our rules is auto-suggestable, but this change will help improve discovery of the relatively-new auto-suggestion feature, especially as more rules implement one.
Autofixers
While adding tests that this suggestion notice is properly present in the rule documentation file of any suggestable rules, I also added a test that the autofixer notice is present for fixable rules. In doing this, I standardized the fixable/suggestion notices at the top of the rule docs with the corresponding emojis, and added the fixable notice to many rule docs that were missing it.