Skip to content

Commit

Permalink
chore: fix update scripts (#93)
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelDeBoey authored Jul 31, 2023
1 parent 3451236 commit 7b9078e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/update-docs-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const { withCategories } = require("./lib/rules")
*/
function toTableRow(rule) {
const mark = `${rule.recommended ? "🌟" : ""}${rule.fixable ? "✒️" : ""}`
const link = `[eslint-comments/<wbr>${rule.name}](./${rule.name}.md)`
const link = `[@eslint-community/eslint-comments/<wbr>${rule.name}](./${rule.name}.md)`
const description = rule.description || "(no description)"
return `| ${link} | ${description} | ${mark} |`
}
Expand All @@ -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")}
Expand Down
10 changes: 6 additions & 4 deletions scripts/update-recommended-rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand All @@ -24,5 +22,9 @@ module.exports = {
.join("\n ")}
},
}
`)
`).then((content) =>
fs.writeFileSync(
path.resolve(__dirname, "../lib/configs/recommended.js"),
content
)
)

0 comments on commit 7b9078e

Please sign in to comment.