Skip to content

Commit

Permalink
feat(website): open issue with rule name if only one rule is enabled (#…
Browse files Browse the repository at this point in the history
…5190)

* feat(website): open issue with rule name if only one rule is enabled

* Update packages/website/src/components/lib/markdown.ts

Co-authored-by: Armano <armano2@users.noreply.github.com>

Co-authored-by: Armano <armano2@users.noreply.github.com>
  • Loading branch information
JoshuaKGoldberg and armano2 committed Jun 18, 2022
1 parent 2a345b4 commit b229ee4
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion packages/website/src/components/lib/markdown.ts
@@ -1,3 +1,4 @@
import { parseESLintRC } from '../config/utils';
import type { ConfigModel } from '../types';

export function createSummary(
Expand Down Expand Up @@ -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] <short description of the issue>',
title: `Bug: [${onlyRuleName}] <short description of the issue>`,
'playground-link': document.location.toString(),
'repro-code': state.code,
'eslint-config': `module.exports = ${state.eslintrc ?? '{}'}`,
Expand Down

0 comments on commit b229ee4

Please sign in to comment.