From 7b9078ec46a589658aed57f2052c8b9dbd4aa4e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20De=20Boey?= Date: Mon, 31 Jul 2023 15:55:41 +0200 Subject: [PATCH] chore: fix update scripts (#93) --- scripts/update-docs-index.js | 4 ++-- scripts/update-recommended-rules.js | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/scripts/update-docs-index.js b/scripts/update-docs-index.js index a766792..f86ca98 100644 --- a/scripts/update-docs-index.js +++ b/scripts/update-docs-index.js @@ -15,7 +15,7 @@ const { withCategories } = require("./lib/rules") */ function toTableRow(rule) { const mark = `${rule.recommended ? "🌟" : ""}${rule.fixable ? "✒️" : ""}` - const link = `[eslint-comments/${rule.name}](./${rule.name}.md)` + const link = `[@eslint-community/eslint-comments/${rule.name}](./${rule.name}.md)` const description = rule.description || "(no description)" return `| ${link} | ${description} | ${mark} |` } @@ -38,7 +38,7 @@ fs.writeFileSync( path.resolve(__dirname, "../docs/rules/README.md"), `# Available Rules -- 🌟 mark: the rule which is enabled by \`eslint-comments/recommended\` preset. +- 🌟 mark: the rule which is enabled by \`@eslint-community/eslint-comments/recommended\` preset. - ✒️ mark: the rule which is fixable by \`eslint --fix\` command. ${withCategories.map(toCategorySection).join("\n")} diff --git a/scripts/update-recommended-rules.js b/scripts/update-recommended-rules.js index ebaaed6..a421132 100644 --- a/scripts/update-recommended-rules.js +++ b/scripts/update-recommended-rules.js @@ -10,9 +10,7 @@ const rules = require("./lib/rules") const { format } = require("./lib/utils") // recommended.js -fs.writeFileSync( - path.resolve(__dirname, "../lib/configs/recommended.js"), - format(`/** DON'T EDIT THIS FILE; was created by scripts. */ +format(`/** DON'T EDIT THIS FILE; was created by scripts. */ "use strict" module.exports = { @@ -24,5 +22,9 @@ module.exports = { .join("\n ")} }, } -`) +`).then((content) => + fs.writeFileSync( + path.resolve(__dirname, "../lib/configs/recommended.js"), + content + ) )