Skip to content

Commit d5d60bd

Browse files
committed
feat: 「〜でる」→「〜でいる」のい抜き言葉を検知できるように
1 parent 737b5b4 commit d5d60bd

File tree

3 files changed

+24
-5
lines changed

3 files changed

+24
-5
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
い抜き言葉を検出する[textlint](https://github.com/textlint/textlint "textlint")ルールです。
44

5-
- ◯ 開発しています。 / 開発している。
6-
- ✗ 開発してます。 / 開発してる。
5+
|| × |
6+
| --- | --- |
7+
| 開発しています。 | 開発してます。 |
8+
| 見学している。 | 見学してる。 |
9+
| 遊んでいる。 | 遊んでる。 |
710

811
## Installation
912

src/no-dropping-i.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function isTeruTargetWord(token){
1616
}
1717

1818
function isTeruWord(token) {
19-
return token.pos === "動詞" && token.pos_detail_1 === "非自立" && token.basic_form === "てる";
19+
return token.pos === "動詞" && token.pos_detail_1 === "非自立" && (token.basic_form === "てる" || token.basic_form === "でる");
2020
}
2121

2222
module.exports = function(context) {

test/test.js

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,13 @@ import TextLintTester from "textlint-tester";
33

44
const tester = new TextLintTester();
55
tester.run("no-dropping-i", rule, {
6-
valid: ["見ています", "開発しています。", "笑っている。", "見学している。"],
6+
valid: [
7+
"見ています",
8+
"開発しています。",
9+
"笑っている。",
10+
"見学している。",
11+
"遊んでいる。",
12+
],
713
invalid: [
814
{
915
text: "見てます。",
@@ -44,6 +50,16 @@ tester.run("no-dropping-i", rule, {
4450
column: 4
4551
}
4652
]
47-
}
53+
},
54+
{
55+
text: "遊んでる。",
56+
errors: [
57+
{
58+
message: "い抜き言葉を使用しています。",
59+
line: 1,
60+
column: 3
61+
}
62+
]
63+
},
4864
]
4965
});

0 commit comments

Comments
 (0)