diff --git a/index.js b/index.js index f60c02d..25b6dc9 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,7 @@ function normalizeComment(comment /*: Comment */) /*: string */ { trimmed.forEach((line, index) => { let offset = index === 0 && start === 0 ? startPos : 0; let match = line.match(SPACE_UNTIL_CONTENT); - if (match) { + if (match && !EMPTY_LINE.test(line)) { indents.push(offset + match[0].length); } }); diff --git a/test.js b/test.js index 3dddada..f01d2d8 100644 --- a/test.js +++ b/test.js @@ -95,11 +95,13 @@ cases('normalizeComments()', opts => { code: ` /** * comment + * * comment */ `, output: ` comment + comment `, },