diff --git a/packages/website/src/components/lib/markdown.ts b/packages/website/src/components/lib/markdown.ts index ab9175dc2f0..4c27e26c593 100644 --- a/packages/website/src/components/lib/markdown.ts +++ b/packages/website/src/components/lib/markdown.ts @@ -1,3 +1,4 @@ +import { parseESLintRC } from '../config/utils'; import type { ConfigModel } from '../types'; export function createSummary( @@ -49,10 +50,18 @@ export function createMarkdown(state: ConfigModel): string { } export function createMarkdownParams(state: ConfigModel): string { + const { rules } = parseESLintRC(state.eslintrc); + const ruleKeys = Object.keys(rules); + + const onlyRuleName = + ruleKeys.length === 1 + ? ruleKeys[0].replace('@typescript-eslint/', '') + : 'rule name here'; + const params = { labels: 'bug,package: eslint-plugin,triage', template: '1-bug-report-plugin.yaml', - title: 'Bug: [rule name here] ', + title: `Bug: [${onlyRuleName}] `, 'playground-link': document.location.toString(), 'repro-code': state.code, 'eslint-config': `module.exports = ${state.eslintrc ?? '{}'}`,