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

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

Share