Skip to content

feat: Add separator characters #6

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

Closed
wants to merge 2 commits into from
Closed
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 src/no-doubled-conjunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export default function (context, options = {}) {
const text = source.toString();
const isSentenceNode = (node) => node.type === SentenceSyntax.Sentence;
let sentences = splitSentences(text, {
charRegExp: /[。\?\!?!]/
charRegExp: /[..。\?\!?!]/
}).filter(isSentenceNode);
// if not have a sentence, early return
// It is for avoiding error of emptyArray.reduce().
Expand Down
13 changes: 12 additions & 1 deletion test/no-doubled-conjunction.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,18 @@ tester.run("no-doubled-conjunction", rule, {
column: 53
}
]
}
},
{
text: "かな漢字変換により漢字が多用される傾向がある.しかし漢字の多用が読みにくさをもたらす側面は否定できない.しかし、平仮名が多い文は間延びした印象を与える恐れもある。",
errors: [
{
message: `同じ接続詞が連続して使われています。`,
// last match
line: 1,
column: 53
}
]
}

]
});