Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/4.2.6.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ module.exports = function (context) {
const matches = mergeMatches(leftMatches, rightMatches);
matches.forEach((match) => {
const { index } = match;
// 数値の符号としてのハイフンは許可する
const nextChar = text[index + 1];
if (nextChar && /[0-9]/.test(nextChar)) {
return;
}
report(
node,
new RuleError(
Expand Down
3 changes: 2 additions & 1 deletion test/4.2.6-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ tester.run("4.2.6.ハイフン(-)", rule, {
"千代田区一番町 1-1-1",
"03-5555-xxxxx",
"電話番号は090-1234-5678です",
"Allen Wirfs-Brock(アレン・ワーフスブラック)"
"Allen Wirfs-Brock(アレン・ワーフスブラック)",
"サイン関数は-1から1の範囲の値をとる"
],
invalid: [
{
Expand Down