Skip to content

Commit 2e10f17

Browse files
committed
Use index instead of column (#3)
* Use index instead of column * multiline support close #2
1 parent a404982 commit 2e10f17

9 files changed

+25
-15
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"babel-preset-es2015": "^6.3.13",
3737
"babel-register": "^6.3.13",
3838
"mocha": "^2.3.4",
39-
"textlint-tester": "^0.4.1"
39+
"textlint-tester": "^1.2.0"
4040
},
4141
"dependencies": {
4242
"kuromojin": "^1.1.0"

src/rules/naidemo-nai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ export default function (context) {
5151
return (token) => {
5252
if (matchPatternないでもない(token)) {
5353
return new RuleError("二重否定: 〜ないでもない", {
54-
column: token.word_position - 1
54+
index: token.word_position - 1
5555
});
5656
}
5757
if (matchPatternないではない(token)) {
5858
return new RuleError("二重否定: 〜ないではない", {
59-
column: token.word_position - 1
59+
index: token.word_position - 1
6060
});
6161
}
6262
};

src/rules/naikotoha-nai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ export default function (context) {
4444
return (token) => {
4545
if (matchPatternないことはない(token)) {
4646
return new RuleError("二重否定: 〜ないことはない", {
47-
column: token.word_position - 1
47+
index: token.word_position - 1
4848
});
4949
}
5050
if (matchPatternないこともない(token)) {
5151
return new RuleError("二重否定: 〜ないこともない", {
52-
column: token.word_position - 1
52+
index: token.word_position - 1
5353
});
5454
}
5555
};

src/rules/naimonodeha-nai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,12 +52,12 @@ export default function (context) {
5252
return (token) => {
5353
if (matchPatternないものでもない(token)) {
5454
return new RuleError("二重否定: 〜ないものでもない", {
55-
column: token.word_position - 1
55+
index: token.word_position - 1
5656
});
5757
}
5858
if (matchPatternないものではない(token)) {
5959
return new RuleError("二重否定: 〜ないものではない", {
60-
column: token.word_position - 1
60+
index: token.word_position - 1
6161
});
6262
}
6363
};

src/rules/naitohaiikire-nai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ export default function (context) {
5151
return (token) => {
5252
if (matchPatternないといいきれない(token)) {
5353
return new RuleError("二重否定: 〜ないといいきれない", {
54-
column: token.word_position - 1
54+
index: token.word_position - 1
5555
});
5656
}
5757
if (matchPatternないとはいいきれない(token)) {
5858
return new RuleError("二重否定: 〜ないとはいいきれない", {
59-
column: token.word_position - 1
59+
index: token.word_position - 1
6060
});
6161
}
6262
};

src/rules/naitohakagira-nai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ export default function (context) {
4949
return (token) => {
5050
if (matchPatternないとはかぎらない(token)) {
5151
return new RuleError("二重否定: 〜ないとはかぎらない", {
52-
column: token.word_position - 1
52+
index: token.word_position - 1
5353
});
5454
}
5555
if (matchPatternないともかぎらない(token)) {
5656
return new RuleError("二重否定: 〜ないともかぎらない", {
57-
column: token.word_position - 1
57+
index: token.word_position - 1
5858
});
5959
}
6060
};

src/rules/naiwakedeha-nai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ export default function (context) {
5050
return (token) => {
5151
if (matchPatternないわけでもない(token)) {
5252
return new RuleError("二重否定: 〜ないわけでもない", {
53-
column: token.word_position - 1
53+
index: token.word_position - 1
5454
});
5555
}
5656
if (matchPatternないわけではない(token)) {
5757
return new RuleError("二重否定: 〜ないわけではない", {
58-
column: token.word_position - 1
58+
index: token.word_position - 1
5959
});
6060
}
6161
};

src/rules/nakuha-nai.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ export default function (context) {
3838
return (token) => {
3939
if (matchPatternなくもない(token)) {
4040
return new RuleError("二重否定: 〜なくもない", {
41-
column: token.word_position - 1
41+
index: token.word_position - 1
4242
});
4343
}
4444
if (matchPatternなくはない(token)) {
4545
return new RuleError("二重否定: 〜なくはない", {
46-
column: token.word_position - 1
46+
index: token.word_position - 1
4747
});
4848
}
4949
};

test/no-doubled-negative-ja-test.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ tester.run("no-doubled-negative", rule, {
2323
}
2424
]
2525
},
26+
{// multiline
27+
text: "いや、\n本音を言えば、\nそれよりこちらの方が大事ではないかという思いもなくはなかった。",
28+
errors: [
29+
{
30+
message: "二重否定: 〜なくはない",
31+
line: 3,
32+
column: 27
33+
}
34+
]
35+
},
2636
{
2737
text: "いや、本音を言えば、それよりこちらの方が大事ではないかという思いもなくはなかった。",
2838
errors: [

0 commit comments

Comments
 (0)