Skip to content

Commit

Permalink
Remove unnecessary intermediate variable
Browse files Browse the repository at this point in the history
  • Loading branch information
FloEdelmann committed Dec 9, 2024
1 parent fc241c1 commit dad2fff
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions tools/update-docs-rules-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,24 +249,16 @@ const releases = [
])
)
].sort()
const linkDefinitionLines = [
'<!-- link definitions for rules -->',
'',
...rules.map((rule) => `[${rule.ruleId}]: ./${rule.name}.md`),
'',
'<!-- link definitions for removed rules -->',
'',
...removedRules.map(
(rule) => `[vue/${rule.ruleName}]: ./${rule.ruleName}.md`
),
'',
'<!-- link definitions for releases -->',
'',
...releases.map(
(release) =>
`[${release}]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/${release}`
)
]
const ruleLinkDefinitions = rules.map(
(rule) => `[${rule.ruleId}]: ./${rule.name}.md`
)
const removedRuleLinkDefinitions = removedRules.map(
(rule) => `[vue/${rule.ruleName}]: ./${rule.ruleName}.md`
)
const releaseLinkDefinitions = releases.map(
(release) =>
`[${release}]: https://github.com/vuejs/eslint-plugin-vue/releases/tag/${release}`
)

// -----------------------------------------------------------------------------
const readmeFilePath = path.resolve(__dirname, '../docs/rules/index.md')
Expand Down Expand Up @@ -295,6 +287,16 @@ Mark indicating rule type:
${rulesTableContent.trim()}
${linkDefinitionLines.join('\n')}
<!-- link definitions for rules -->
${ruleLinkDefinitions.join('\n')}
<!-- link definitions for removed rules -->
${removedRuleLinkDefinitions.join('\n')}
<!-- link definitions for releases -->
${releaseLinkDefinitions.join('\n')}
`
)

0 comments on commit dad2fff

Please sign in to comment.