Skip to content

Commit 4061ce5

Browse files
committed
feat: 全角コロンで区切られるパターンを検知する
1 parent 3e28e96 commit 4061ce5

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/rules/no-ai-list-formatting.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,15 @@ const rule: TextlintRuleModule<Options> = (context: TextlintRuleContext, options
7979

8080
// Check for bold list item pattern: - **text**: description
8181
if (!disableBoldListItems) {
82-
const boldListPattern = /^[\s]*[-*+]\s+\*\*([^*]+)\*\*\s*:/;
82+
const boldListPattern = /^[\s]*[-*+]\s+\*\*([^*]+)\*\*\s*([:])/;
8383
const boldMatch: RegExpMatchArray | null = text.match(boldListPattern);
8484
if (boldMatch) {
8585
const matchStart: number = boldMatch.index ?? 0;
8686
const matchEnd = matchStart + boldMatch[0].length;
8787
const matchRange = [matchStart, matchEnd] as const;
88+
const colon = boldMatch[2];
8889
const ruleError = new RuleError(
89-
"リストアイテムで強調(**)とコロン(:)の組み合わせは機械的な印象を与える可能性があります。より自然な表現を検討してください。",
90+
`リストアイテムで強調(**)とコロン(${colon})の組み合わせは機械的な印象を与える可能性があります。より自然な表現を検討してください。`,
9091
{
9192
padding: locator.range(matchRange)
9293
}

0 commit comments

Comments
 (0)