Skip to content

Commit

Permalink
Fix: no-multiple-empty-lines duplicate errors at BOF (fixes #6113) (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
alberto committed May 12, 2016
1 parent e6f56da commit 52fdf04
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/rules/no-multiple-empty-lines.js
Expand Up @@ -122,6 +122,8 @@ module.exports = {

// Aggregate and count blank lines
if (firstNonBlankLine > maxBOF) {
currentLocation = firstNonBlankLine - 1;

context.report(node, 0,
"Too many blank lines at the beginning of file. Max of " + maxBOF + " allowed.");
}
Expand Down
4 changes: 1 addition & 3 deletions tests/lib/rules/no-multiple-empty-lines.js
Expand Up @@ -218,8 +218,7 @@ ruleTester.run("no-multiple-empty-lines", rule, {
},
{
code: "\n\n\n\n\n// invalid 16\nvar a = 5;\n",
errors: [ getExpectedErrorBOF(4),
getExpectedError(0) ],
errors: [ getExpectedErrorBOF(4)],
options: [ { max: 0, maxBOF: 4 } ]
},
{
Expand All @@ -235,7 +234,6 @@ ruleTester.run("no-multiple-empty-lines", rule, {
{
code: "\n\n\n// invalid 19\nvar a = 5;\n\n",
errors: [ getExpectedErrorBOF(0),
getExpectedError(2),
getExpectedErrorEOF(0) ],
options: [ { max: 2, maxBOF: 0, maxEOF: 0 } ]
}
Expand Down

0 comments on commit 52fdf04

Please sign in to comment.