Skip to content

Commit ccde696

Browse files
authored
fix(4.2.6): 数値の符号としてのハイフンを許可する (#154)
1 parent b15f148 commit ccde696

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/4.2.6.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ module.exports = function (context) {
2828
const matches = mergeMatches(leftMatches, rightMatches);
2929
matches.forEach((match) => {
3030
const { index } = match;
31+
// 数値の符号としてのハイフンは許可する
32+
const nextChar = text[index + 1];
33+
if (nextChar && /[0-9]/.test(nextChar)) {
34+
return;
35+
}
3136
report(
3237
node,
3338
new RuleError(

test/4.2.6-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ tester.run("4.2.6.ハイフン(-)", rule, {
88
"千代田区一番町 1-1-1",
99
"03-5555-xxxxx",
1010
"電話番号は090-1234-5678です",
11-
"Allen Wirfs-Brock(アレン・ワーフスブラック)"
11+
"Allen Wirfs-Brock(アレン・ワーフスブラック)",
12+
"サイン関数は-1から1の範囲の値をとる"
1213
],
1314
invalid: [
1415
{

0 commit comments

Comments
 (0)