diff --git a/_data/rules.yml b/_data/rules.yml index f967cd825b6..e63165aad34 100644 --- a/_data/rules.yml +++ b/_data/rules.yml @@ -164,6 +164,7 @@ categories: fixable: false name: no-unsafe-negation recommended: true + hasSuggestions: true - description: >- disallow use of optional chaining in contexts where the `undefined` value is not allowed @@ -387,6 +388,7 @@ categories: fixable: false name: no-nonoctal-decimal-escape recommended: false + hasSuggestions: true - description: disallow octal literals fixable: false name: no-octal @@ -467,6 +469,7 @@ categories: fixable: false name: no-useless-escape recommended: true + hasSuggestions: true - description: disallow redundant return statements fixable: true name: no-useless-return @@ -503,6 +506,7 @@ categories: fixable: false name: radix recommended: false + hasSuggestions: true - description: disallow async functions which have no `await` expression fixable: false name: require-await diff --git a/_layouts/doc.liquid b/_layouts/doc.liquid index 0925491cafb..ede7955454d 100644 --- a/_layouts/doc.liquid +++ b/_layouts/doc.liquid @@ -30,6 +30,7 @@ | replace: '

(fixable) ', '

' | replace: '(recommended)', '' | replace: '(fixable)', '🔧' + | replace: '(hasSuggestions)', '💡' }} diff --git a/_layouts/rules.liquid b/_layouts/rules.liquid index 536de582fec..2c9e1175f97 100644 --- a/_layouts/rules.liquid +++ b/_layouts/rules.liquid @@ -16,6 +16,7 @@ {{ content | replace: '(recommended)', '' | replace: '(fixable)', '🔧' + | replace: '(hasSuggestions)', '💡' }} diff --git a/docs/rules/README.md b/docs/rules/README.md index eba1b7be8d0..b406d822ffc 100644 --- a/docs/rules/README.md +++ b/docs/rules/README.md @@ -1,10 +1,10 @@ # Rules -Rules in ESLint are grouped by category to help you understand their purpose. +Rules in ESLint are grouped by category to help you understand their purpose. Each rule has emojis denoting: -No rules are enabled by default. The `"extends": "eslint:recommended"` property in a [configuration file](../user-guide/configuring#extending-configuration-files) enables rules that report common problems, which have a check mark (recommended) below. - -The `--fix` option on the [command line](../user-guide/command-line-interface#fix) automatically fixes problems (currently mostly whitespace) reported by rules which have a wrench (fixable) below. +* (recommended) if the `"extends": "eslint:recommended"` property in a [configuration file](../user-guide/configuring#extending-configuration-files) enables the rule +* (fixable) if some problems reported by the rule are automatically fixable by the `--fix` [command line](../user-guide/command-line-interface#fix) option +* (hasSuggestions) if some problems reported by the rule are manually fixable by editor [suggestions](https://eslint.org/docs/developer-guide/working-with-rules#providing-suggestions) ## Possible Errors diff --git a/docs/rules/index.liquid b/docs/rules/index.liquid index e0909272c24..df5c8a9db4a 100644 --- a/docs/rules/index.liquid +++ b/docs/rules/index.liquid @@ -14,6 +14,7 @@ layout: doc + @@ -22,6 +23,7 @@ layout: doc {% if rule.recommended %}(recommended){% endif %} {% if rule.fixable %}(fixable){% endif %} + {% if rule.hasSuggestions %}(hasSuggestions){% endif %} {{ rule.name }} {{ rule.description }} diff --git a/src/styles/lib/overrides.less b/src/styles/lib/overrides.less index dcfd446a654..e395eb9b17a 100644 --- a/src/styles/lib/overrides.less +++ b/src/styles/lib/overrides.less @@ -100,6 +100,10 @@ p { content: "🔧"; /* wrench */ } + &.hasSuggestions:before { + content: "💡"; /* lightbulb */ + } + &.incorrect:before { content: "\e126"; /* thumbs-down */ }