Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
[Syntax.Str](node) {
if (helper.isChildNode(node, [Syntax.Link, Syntax.Image, Syntax.BlockQuote, Syntax.Emphasis])) {
return;
}
const text = getSource(node);
return kuromojin(text).then(tokens => {
tokens.forEach(token => {
if (isKoreru(token)) {
report(
node,
new RuleError("ら抜き言葉を使用しています。", {
index: token.word_position
})
);
}
});
// tokenのペアがない場合は無視する
if (tokens.length <= 1) {
return;
}
tokens.reduce((prev, current) => {
if (isTargetVerb(prev) && isRaWord(current)) {