Browse Source

whitespace-only-lines fix

CrazyDoctor 2 years ago
parent
commit
b4cedf226c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      index.js

+ 1 - 1
index.js

@@ -258,7 +258,7 @@ module.exports = {
 									loc: {line: index + 1, column: 0},
 									loc: {line: index + 1, column: 0},
 									message: 'Empty line with only whitespace',
 									message: 'Empty line with only whitespace',
 									fix: function(fixer) {
 									fix: function(fixer) {
-										return fixer.replaceTextRange([sourceCode.getIndexFromLoc({line: index, column: 0}), sourceCode.getIndexFromLoc({line: index, column: line.length})], '');
+										return fixer.replaceTextRange([sourceCode.getIndexFromLoc({line: index + 1, column: 0}), sourceCode.getIndexFromLoc({line: index + 1, column: line.length})], '');
 									}
 									}
 								});
 								});
 							}
 							}