Allowing Repeated Japanese Words Like なぜなぜ, あるある, and よくよく in textlint

How to specify them with allow


Posted on Mon, May 27, 2024
Tags textlint
textlint
📝 This article is a translation of the original Japanese post. View original

textlint Flags Words Like 「なぜなぜ分析」 and 「あるあるだが」

Recently I introduced automated checks with textlint in CI/CD to proofread this blog. It’s good for noticing my own writing habits, but by default it also flags words like 「あるあるの事象」 (a classic case) and 「なぜなぜ分析をする」 (do a five-whys analysis).

The rule that flags these is ja-no-successive-word, which is included in ja-technical-writing. Adding the setting below to .textlintrc.json lets you allow expressions like 「よくよく考えると」.

 1"rules": {
 2    "preset-ja-technical-writing": {
 3        "ja-no-successive-word": {
 4            "allow": [
 5                "なぜ",
 6                "よく",
 7                "ある"
 8            ]
 9        },
10    }
11}

The Current Configuration Used on This Blog

I ran into a number of snags, so for reference here is the configuration applied in this blog’s case.

 1{
 2    "rules": {
 3        "no-todo": true,
 4        "preset-ja-technical-writing": {
 5            "sentence-length": false,
 6            "max-kanji-continuous-len": false,
 7            "max-comma": false,
 8            "max-ten": false,
 9            "no-exclamation-question-mark": false,
10            "ja-no-weak-phrase": false,
11            "ja-no-mixed-period": {
12                "periodMark": "。",
13                "allowPeriodMarks": [
14                    "、",
15                    "...",
16                    "…",
17                    ":",
18                    ":"
19                ],
20                "allowEmojiAtEnd": false,
21                "forceAppendPeriod": false
22            },
23            "ja-no-successive-word": {
24                "allow": [
25                    "なぜ",
26                    "よく",
27                    "ある"
28                ]
29            }
30        },
31        "spellcheck-tech-word": true
32    },
33    "filters": {
34        "allowlist": {
35            "allow": [
36                "%",
37                ".git",
38                ".gitignore",
39                "Activity",
40                "Disk",
41                "git",
42                "IO",
43                "scheme"
44            ]
45        }
46    }
47}

Share