Skip to content

Commit

Permalink
Fix the error message (#23)
Browse files Browse the repository at this point in the history
* Fix the error message

- 文字「が」見つかる (名詞 + be found) / 文字「を」見つける (find + 名詞) のどちらかであるべきなので、このような際のエラーメッセージに典型的に用いられる "Cannot find + 名詞" と表現。
- 両者を見せるエラーメッセージは This pair of (punctuation) marks などとするのがよい(cf. https://en.wikipedia.org/wiki/Guillemet )ので、その旨修正。

* The test must also be modified accordingly
  • Loading branch information
hsjoihs authored Nov 7, 2024
1 parent 269d0c6 commit b3bbe21
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/textlint-rule-no-unmatched-pair.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ const report = (context) => {
report(
node,
new RuleError(
`Not found pair character for ${contextLocation.pairMark.start}.
`Cannot find a pairing character for ${contextLocation.pairMark.start}.
You should close this sentence with ${contextLocation.pairMark.end}.
This pair mark is called ${contextLocation.pairMark.key}.`,
This pair of marks is called ${contextLocation.pairMark.key}.`,
{
index: sentenceIndex - node.range[0] + contextLocation.index
}
Expand Down
8 changes: 4 additions & 4 deletions test/textlint-rule-no-unmatched-pair-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ tester.run("textlint-rule-no-unmatched-pair", rule, {
errors: [
{
index: 4,
message: `Not found pair character for (.
message: `Cannot find a pairing character for (.
You should close this sentence with ).
This pair mark is called 丸括弧().`
This pair of marks is called 丸括弧().`
}
]
},
Expand All @@ -59,10 +59,10 @@ This pair mark is called 丸括弧().`
errors: [
{
index: 11,
message: `Not found pair character for ".
message: `Cannot find a pairing character for ".
You should close this sentence with ".
This pair mark is called double quote.`
This pair of marks is called double quote.`
}
]
},
Expand Down

0 comments on commit b3bbe21

Please sign in to comment.