Skip to content

Commit c484a31

Browse files
committed
feat(rule): add 典型例
1 parent 070747c commit c484a31

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ textlint --rule ja-unnatural-alphabet README.md
4949

5050
- `allow`: `string[]`
5151
- 無視するアルファベットの配列
52-
- デフォルト: `["a", "i", "u", "e", "o", "n", "/[a-zA-Za-zA-Z]言語/"]`
52+
- デフォルト: `["a", "i", "u", "e", "o", "n", 典型例 ]`
5353
- デフォルトでは母音とnを除外している
5454
- `"/正規表現/" のような文字列もサポート
5555

src/textlint-rule-ja-unnatural-alphabet.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,14 @@ const defaultOptions = {
6262
// 無視するアルファベット
6363
// 例) ["X"]
6464
// デフォルトでは母音とnと典型例を除外している
65-
"allow": ["a", "i", "u", "e", "o", "n", "/[a-zA-Za-zA-Z]言語/"]
65+
"allow": [
66+
"a", "i", "u", "e", "o",
67+
"n",
68+
"/[a-zA-Za-zA-Z]言語/",
69+
"/[x-zX-Z]座標/",
70+
"/[x-zX-Z]軸/",
71+
"Eメール"
72+
]
6673
};
6774
const report = (context, options = {}) => {
6875
const { Syntax, RuleError, report, getSource } = context;

test/textlint-rule-ja-unnatural-alphabet-test.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ tester.run("textlint-rule-ja-unnatural-alphabet", rule, {
1212
"This is pen.",
1313
"これはC言語",
1414
"これはD言語",
15+
"これはX座標",
16+
"これはX軸",
17+
"これはEメール",
1518
{
1619
text: "アンドロイドNは良し",
1720
options: {

0 commit comments

Comments
 (0)