Skip to content

Commit

Permalink
fix: Codeと句読点 が並んだ場合に、が無視される問題を修正 (#53)
Browse files Browse the repository at this point in the history
> 関数宣言で関数`fn1`、関数式で関数`fn2`を定義する

はエラーではなくなる
  • Loading branch information
azu authored Jul 16, 2023
1 parent b9ee499 commit 575a162
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/no-doubled-joshi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ const report: TextlintRuleModule<Options> = function (context, options = {}) {
* このルールでは単純に無視したいので、同じ文字数で意味のない文字列に置き換える
*/
if (node.type === Syntax.Code) {
return maskValue("_");
return maskValue("");
}
return;
}
Expand Down
3 changes: 3 additions & 0 deletions test/no-doubled-joshi-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@ tester.run("no-double-joshi", rule, {
"昨日は「今日は早朝から出発したが、定刻には間に合わなかった。定刻には間に合わなかったが、無事会場に到着した」と思った",
"「今日は早朝から出発したが、定刻には間に合わなかった。定刻には間に合わなかったが、無事会場に到着した」",
`"今日は早朝から出発したが、定刻には間に合わなかった。定刻には間に合わなかったが、無事会場に到着した"`,
// `Code`、となった場合に、`、`が間隔値として扱われない問題のテスト
// https://github.com/textlint-ja/textlint-rule-no-doubled-joshi/issues/52
"関数宣言で関数`fn1`、関数式で関数`fn2`を定義する",
// 格助詞の種類が異なる
// "プロパティを削除しようとするとエラーが発生します。",
// 「でも」と「も」は並列としても扱うケースがある
Expand Down

0 comments on commit 575a162

Please sign in to comment.