diff --git a/src/rules/no-ai-list-formatting.ts b/src/rules/no-ai-list-formatting.ts index d827428..5d43bc4 100644 --- a/src/rules/no-ai-list-formatting.ts +++ b/src/rules/no-ai-list-formatting.ts @@ -79,14 +79,15 @@ const rule: TextlintRuleModule = (context: TextlintRuleContext, options // Check for bold list item pattern: - **text**: description if (!disableBoldListItems) { - const boldListPattern = /^[\s]*[-*+]\s+\*\*([^*]+)\*\*\s*:/; + const boldListPattern = /^[\s]*[-*+]\s+\*\*([^*]+)\*\*\s*([::])/; const boldMatch: RegExpMatchArray | null = text.match(boldListPattern); if (boldMatch) { const matchStart: number = boldMatch.index ?? 0; const matchEnd = matchStart + boldMatch[0].length; const matchRange = [matchStart, matchEnd] as const; + const colon = boldMatch[2]; const ruleError = new RuleError( - "リストアイテムで強調(**)とコロン(:)の組み合わせは機械的な印象を与える可能性があります。より自然な表現を検討してください。", + `リストアイテムで強調(**)とコロン(${colon})の組み合わせは機械的な印象を与える可能性があります。より自然な表現を検討してください。`, { padding: locator.range(matchRange) } diff --git a/test/rules/no-ai-list-formatting.test.ts b/test/rules/no-ai-list-formatting.test.ts index 265058c..ab74277 100644 --- a/test/rules/no-ai-list-formatting.test.ts +++ b/test/rules/no-ai-list-formatting.test.ts @@ -175,6 +175,17 @@ tester.run("no-ai-list-formatting", noAiListFormatting, { range: [2, 4] } ] + }, + // Full-width colon + { + text: "- **重要情報**:これは重要な項目です", + errors: [ + { + message: + "リストアイテムで強調(**)とコロン(:)の組み合わせは機械的な印象を与える可能性があります。より自然な表現を検討してください。", + range: [0, 11] + } + ] } ] });