Skip to content

Use index instead of column #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 2, 2016
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"babel-preset-es2015": "^6.3.13",
"babel-register": "^6.3.13",
"mocha": "^2.3.4",
"textlint-tester": "^0.4.1"
"textlint-tester": "^1.2.0"
},
"dependencies": {
"kuromojin": "^1.1.0"
Expand Down
4 changes: 2 additions & 2 deletions src/rules/naidemo-nai.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export default function (context) {
return (token) => {
if (matchPatternないでもない(token)) {
return new RuleError("二重否定: 〜ないでもない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
if (matchPatternないではない(token)) {
return new RuleError("二重否定: 〜ないではない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/rules/naikotoha-nai.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ export default function (context) {
return (token) => {
if (matchPatternないことはない(token)) {
return new RuleError("二重否定: 〜ないことはない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
if (matchPatternないこともない(token)) {
return new RuleError("二重否定: 〜ないこともない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/rules/naimonodeha-nai.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export default function (context) {
return (token) => {
if (matchPatternないものでもない(token)) {
return new RuleError("二重否定: 〜ないものでもない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
if (matchPatternないものではない(token)) {
return new RuleError("二重否定: 〜ないものではない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/rules/naitohaiikire-nai.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,12 @@ export default function (context) {
return (token) => {
if (matchPatternないといいきれない(token)) {
return new RuleError("二重否定: 〜ないといいきれない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
if (matchPatternないとはいいきれない(token)) {
return new RuleError("二重否定: 〜ないとはいいきれない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/rules/naitohakagira-nai.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ export default function (context) {
return (token) => {
if (matchPatternないとはかぎらない(token)) {
return new RuleError("二重否定: 〜ないとはかぎらない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
if (matchPatternないともかぎらない(token)) {
return new RuleError("二重否定: 〜ないともかぎらない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/rules/naiwakedeha-nai.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ export default function (context) {
return (token) => {
if (matchPatternないわけでもない(token)) {
return new RuleError("二重否定: 〜ないわけでもない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
if (matchPatternないわけではない(token)) {
return new RuleError("二重否定: 〜ないわけではない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/rules/nakuha-nai.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ export default function (context) {
return (token) => {
if (matchPatternなくもない(token)) {
return new RuleError("二重否定: 〜なくもない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
if (matchPatternなくはない(token)) {
return new RuleError("二重否定: 〜なくはない", {
column: token.word_position - 1
index: token.word_position - 1
});
}
};
Expand Down
10 changes: 10 additions & 0 deletions test/no-doubled-negative-ja-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,16 @@ tester.run("no-doubled-negative", rule, {
}
]
},
{// multiline
text: "いや、\n本音を言えば、\nそれよりこちらの方が大事ではないかという思いもなくはなかった。",
errors: [
{
message: "二重否定: 〜なくはない",
line: 3,
column: 27
}
]
},
{
text: "いや、本音を言えば、それよりこちらの方が大事ではないかという思いもなくはなかった。",
errors: [
Expand Down