Skip to content

Commit

Permalink
fix: fix to no code error
Browse files Browse the repository at this point in the history
  • Loading branch information
azu committed Apr 25, 2021
1 parent c4f9514 commit 2fa8d56
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/textlint-rule-max-comma.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ export default function (context, options = defaultOptions) {
const paragraphSentenceWithoutNode = filter(paragraphSentence, (node) => {
return node.type !== Syntax.Code;
});
if (!paragraphSentenceWithoutNode) {
return;
}
// This `sum(0,1,2,3,4,5,6,7,8,9,10)` is ok
// → This is ok
const sentencesWithoutCode = paragraphSentenceWithoutNode
Expand Down
1 change: 1 addition & 0 deletions test/textlint-rule-max-comma-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const tester = new TextLintTester();
// ruleName, rule, { valid, invalid }
tester.run("no-todo", rule, {
valid: [
"``", // no content
// no match
"This is text.",
// 4 is ok by default
Expand Down

0 comments on commit 2fa8d56

Please sign in to comment.