Skip to content

Commit

Permalink
Fix: no-multiple-empty-lines errors when no line breaks (fixes eslint…
Browse files Browse the repository at this point in the history
  • Loading branch information
strawbrary committed Jun 18, 2016
1 parent 414206c commit 1e3ee8d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/no-multiple-empty-lines.js
Expand Up @@ -78,7 +78,7 @@ module.exports = {

"Program:exit": function checkBlankLines(node) {
var lines = sourceCode.lines,
fullLines = sourceCode.text.match(/.*(\r\n|\r|\n|\u2028|\u2029)/g),
fullLines = sourceCode.text.match(/.*(\r\n|\r|\n|\u2028|\u2029)/g) || [],
firstNonBlankLine = -1,
trimmedLines = [],
linesRangeStart = [],
Expand Down
4 changes: 4 additions & 0 deletions tests/lib/rules/no-multiple-empty-lines.js
Expand Up @@ -149,6 +149,10 @@ ruleTester.run("no-multiple-empty-lines", rule, {
{
code: "// valid 17\nvar a = 5;\n\n",
options: [ { max: 0, maxEOF: 1 } ]
},
{
code: "var a = 5;",
options: [ { max: 1 } ]
}
],

Expand Down

0 comments on commit 1e3ee8d

Please sign in to comment.