diff --git a/lib/rules/max-empty-lines/__tests__/index.js b/lib/rules/max-empty-lines/__tests__/index.js index 5bd10f321f..ba6ad6fbad 100644 --- a/lib/rules/max-empty-lines/__tests__/index.js +++ b/lib/rules/max-empty-lines/__tests__/index.js @@ -120,6 +120,13 @@ testRule({ line: 5, column: 1, }, + { + code: 'a {}\n\n\n/** horse */\n\nb {}', + fixed: 'a {}\n\n/** horse */\n\nb {}', + message: messages.expected(1), + line: 3, + column: 1, + }, { code: 'a {}\r\n\r\n/** horse */\r\n\r\n\r\nb {}', fixed: 'a {}\r\n\r\n/** horse */\r\n\r\nb {}', diff --git a/lib/rules/max-empty-lines/index.js b/lib/rules/max-empty-lines/index.js index b545457c82..3e8aa9cb4f 100644 --- a/lib/rules/max-empty-lines/index.js +++ b/lib/rules/max-empty-lines/index.js @@ -50,23 +50,14 @@ function rule(max, options, context) { if (context.fix) { root.walk((node) => { if (node.type === 'comment') { - // for inline comments - if (node.raws.inline) { - node.raws.before = getChars(node.raws.before); - } - if (!ignoreComments) { node.raws.left = getChars(node.raws.left); node.raws.right = getChars(node.raws.right); } - } else { - if (node.raws.before) { - node.raws.before = getChars(node.raws.before); - } + } - if (node.raws.after) { - node.raws.after = getChars(node.raws.after); - } + if (node.raws.before) { + node.raws.before = getChars(node.raws.before); } }); diff --git a/system-tests/003/__snapshots__/no-fs.test.js.snap b/system-tests/003/__snapshots__/no-fs.test.js.snap index 33b27ad578..9aa6062945 100644 --- a/system-tests/003/__snapshots__/no-fs.test.js.snap +++ b/system-tests/003/__snapshots__/no-fs.test.js.snap @@ -15,7 +15,6 @@ Object { /* Your images should be linked as if the CSS file sits in the same folder as the images. ie. no paths. */ - /* basic elements */ html { margin: 0; @@ -66,7 +65,6 @@ abbr { border-bottom: none; } - /* specific divs */ .page-wrapper { background: url(http://csszengarden.com/001/zen-bg.jpg) no-repeat top left;