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
Fix: no-multiple-empty-lines errors when no line breaks (fixes #6449) #6451
Fix: no-multiple-empty-lines errors when no line breaks (fixes #6449) #6451
Conversation
LGTM |
By analyzing the blame information on this pull request, we identified @RRMoelker, @vitorbal and @gcochard to be potential reviewers |
LGTM. Leaving open to get some other eyes on it. |
LGTM |
* chore(npm): update devDeps * chore(eslint): avoid error no-multiple-empty-lines eslint/eslint#6449 eslint/eslint#6451
@@ -98,7 +98,7 @@ module.exports = { | |||
|
|||
linesRangeStart.push(0); | |||
lines.forEach(function(str, i) { | |||
var length = i < fullLines.length ? fullLines[i].length : 0, | |||
var length = Array.isArray(fullLines) && i < fullLines.length ? fullLines[i].length : 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could an alternative fix be to add || []
on line 81 above, so that it's always an array, and you don't have to check if it is one N times?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, good call.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the pull with change from @ljharb.
LGTM |
09a8809
to
1e3ee8d
Compare
LGTM |
No description provided.