Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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