Skip to content

Commit 0058c7c

Browse files
authored
fix(lint): allowlist lines with no Japanese characters (#1168)
prh (and other textlint rules) was incorrectly firing on lines that contain no Japanese characters at all — most notably on English-only paragraphs left untranslated by the d-additive defer flow during `/update-origin`. `pnpm lint --fix` would then partially replace tokens like `Signal Forms` with `シグナルフォーム` inside an otherwise pure-English sentence, producing nonsensical bilingual fragments like `シグナルフォームbuilds the field tree...`. Add a textlint filter allowlist pattern that matches any single line containing no Hiragana / Katakana / Han characters and excludes it from rule evaluation. Multi-line English paragraphs are handled line-by-line, so each pure-English line is skipped while truly mixed lines (Japanese prose containing `Signal Forms`) still trigger prh correctly.
1 parent d7e996a commit 0058c7c

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

.textlintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"allowlist": {
55
"allow": [
66
"/<docs-code[\\s\\S]*?</docs-code>/m",
7-
"/\\{#.*\\}/m"
7+
"/\\{#.*\\}/m",
8+
"/^[^\\p{Script=Hiragana}\\p{Script=Katakana}\\p{Script=Han}\\n]+$/mu"
89
]
910
}
1011
},

0 commit comments

Comments
 (0)