Skip to content

Commit ef8a362

Browse files
committed
fix(rule): fix pair name
1 parent 2cca2d3 commit ef8a362

File tree

3 files changed

+23
-12
lines changed

3 files changed

+23
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@ textlint rule that check unmatched pairs like `(` and `]`
66

77
- double quote: `"` and `"`
88
- angled bracket[]: `[` and `]`
9-
- round bracket(): `` and ``
9+
- round bracket(): `(` and `)`
1010
- curly brace{}: `{` and `}`
1111
- かぎ括弧「」: `` and ``
12+
- 丸括弧(): `` and ``
1213
- 二重かぎ括弧『』: `` and ``
13-
- 全角丸括弧(): `(` and `)`
1414
- 波括弧{}: `` and ``
1515
- 角括弧[]: `` and ``
1616
- 重角括弧〚〛: `` and ``

src/parser/PairMaker.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ const PAIR_MARKS = [
2323
end: `]`
2424
},
2525
{
26-
key: "round bracket()",
27-
start: ``,
28-
end: ``
26+
key: "round bracket()",
27+
start: `(`,
28+
end: `)`
2929
},
3030
{
3131
key: "curly brace{}",
@@ -37,16 +37,16 @@ const PAIR_MARKS = [
3737
start: `「`,
3838
end: `」`
3939
},
40+
{
41+
key: "丸括弧()",
42+
start: `(`,
43+
end: `)`
44+
},
4045
{
4146
key: "二重かぎ括弧『』",
4247
start: `『`,
4348
end: `』`
4449
},
45-
{
46-
key: "全角丸括弧()",
47-
start: `(`,
48-
end: `)`
49-
},
5050
{
5151
key: "波括弧{}",
5252
start: `{`,

test/textlint-rule-no-unmatched-pair-test.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ tester.run("textlint-rule-no-unmatched-pair", rule, {
1313
{
1414
text: `John said "Hello World!".`
1515
},
16-
1716
{
1817
text: "`(` is ok."
18+
},
19+
{
20+
text: "文字列リテラルには3種類ありますが、まずは`\"`(ダブルクオート)と`'`(シングルクオート)について見ていきます。"
1921
}
2022
],
2123
invalid: [
@@ -27,7 +29,7 @@ tester.run("textlint-rule-no-unmatched-pair", rule, {
2729
message: `Not found pair character for (.
2830
2931
You should close this sentence with ).
30-
This pair mark is called round bracket().`
32+
This pair mark is called 丸括弧().`
3133
}
3234
]
3335
},
@@ -42,6 +44,15 @@ You should close this sentence with ".
4244
This pair mark is called double quote.`
4345
}
4446
]
47+
},
48+
{
49+
text: "`src/App.js`にファイルを作成し、次のような内容のJavaScriptモジュールとします。\n"
50+
+ "モジュールは、基本的には何かしらを外部に公開(`export`)します。",
51+
errors: [
52+
{
53+
index: 23
54+
}
55+
]
4556
}
4657
]
4758
});

0 commit comments

Comments
 (0)