From a2a28451c089baac7af5db8bf15e4a65155d40f8 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Fri, 23 Jul 2021 14:17:43 -0700 Subject: [PATCH 1/3] Docs: Display emoji/notice for rules with suggestions --- Makefile.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile.js b/Makefile.js index 62b1d76669f..9246e1e786b 100644 --- a/Makefile.js +++ b/Makefile.js @@ -197,7 +197,8 @@ function generateRuleIndexPage() { name: basename, description: rule.meta.docs.description, recommended: rule.meta.docs.recommended || false, - fixable: !!rule.meta.fixable + fixable: !!rule.meta.fixable, + hasSuggestions: !!rule.meta.docs.suggestion || false }, category = categoriesData.categories.find(c => c.name === rule.meta.docs.category); @@ -640,6 +641,7 @@ target.gensite = function(prereleaseVersion) { const RECOMMENDED_TEXT = "\n\n(recommended) The `\"extends\": \"eslint:recommended\"` property in a configuration file enables this rule."; const FIXABLE_TEXT = "\n\n(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule."; + const HAS_SUGGESTIONS_TEXT = "\n\n(hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../user-guide/working-with-rules#providing-suggestions)."; // 4. Loop through all files in temporary directory process.stdout.write("> Updating files (Steps 4-9): 0/... - ...\r"); @@ -669,13 +671,14 @@ target.gensite = function(prereleaseVersion) { const rule = rules.get(ruleName); const isRecommended = rule && rule.meta.docs.recommended; const isFixable = rule && rule.meta.fixable; + const hasSuggestions = rule && rule.meta.docs.suggestion; // Incorporate the special portion into the documentation content const textSplit = text.split("\n"); const ruleHeading = textSplit[0]; const ruleDocsContent = textSplit.slice(1).join("\n"); - text = `${ruleHeading}${isRecommended ? RECOMMENDED_TEXT : ""}${isFixable ? FIXABLE_TEXT : ""}\n${ruleDocsContent}`; + text = `${ruleHeading}${isRecommended ? RECOMMENDED_TEXT : ""}${isFixable ? FIXABLE_TEXT : ""}${hasSuggestions ? HAS_SUGGESTIONS_TEXT : ""}\n${ruleDocsContent}`; title = `${ruleName} - Rules`; if (rule && rule.meta) { From 21d37400951ca302c31988463e3c91f6a42e6c37 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Sun, 25 Jul 2021 23:38:59 -0700 Subject: [PATCH 2/3] Update Makefile.js Co-authored-by: Milos Djermanovic --- Makefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.js b/Makefile.js index 9246e1e786b..dd2c09a4bca 100644 --- a/Makefile.js +++ b/Makefile.js @@ -641,7 +641,7 @@ target.gensite = function(prereleaseVersion) { const RECOMMENDED_TEXT = "\n\n(recommended) The `\"extends\": \"eslint:recommended\"` property in a configuration file enables this rule."; const FIXABLE_TEXT = "\n\n(fixable) The `--fix` option on the [command line](../user-guide/command-line-interface#fixing-problems) can automatically fix some of the problems reported by this rule."; - const HAS_SUGGESTIONS_TEXT = "\n\n(hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../user-guide/working-with-rules#providing-suggestions)."; + const HAS_SUGGESTIONS_TEXT = "\n\n(hasSuggestions) Some problems reported by this rule are manually fixable by editor [suggestions](../developer-guide/working-with-rules#providing-suggestions)."; // 4. Loop through all files in temporary directory process.stdout.write("> Updating files (Steps 4-9): 0/... - ...\r"); From bb4745be4710063708b50713936b37536f6a5343 Mon Sep 17 00:00:00 2001 From: Bryan Mishkin <698306+bmish@users.noreply.github.com> Date: Sun, 25 Jul 2021 23:39:05 -0700 Subject: [PATCH 3/3] Update Makefile.js Co-authored-by: Milos Djermanovic --- Makefile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile.js b/Makefile.js index dd2c09a4bca..6d1ee39198e 100644 --- a/Makefile.js +++ b/Makefile.js @@ -198,7 +198,7 @@ function generateRuleIndexPage() { description: rule.meta.docs.description, recommended: rule.meta.docs.recommended || false, fixable: !!rule.meta.fixable, - hasSuggestions: !!rule.meta.docs.suggestion || false + hasSuggestions: !!rule.meta.docs.suggestion }, category = categoriesData.categories.find(c => c.name === rule.meta.docs.category);