Skip to content
Permalink
Browse files

Fix: Incorrect location for padded-blocks (fixes #4913)

  • Loading branch information...
alberto committed Jan 10, 2016
1 parent 30da59b commit 7f058f3c71ed3c8adb35fc06c68416dabfcccfd1
Showing with 12 additions and 5 deletions.
  1. +10 −3 lib/rules/padded-blocks.js
  2. +2 −2 tests/lib/rules/padded-blocks.js
@@ -96,17 +96,24 @@ module.exports = function(context) {
if (!blockHasTopPadding) {
context.report(node, ALWAYS_MESSAGE);
}

if (!blockHasBottomPadding) {
context.report(node, node.loc.end, ALWAYS_MESSAGE);
context.report({
node: node,
loc: {line: node.loc.end.line, column: node.loc.end.column - 1 },
message: ALWAYS_MESSAGE
});
}
} else {
if (blockHasTopPadding) {
context.report(node, NEVER_MESSAGE);
}

if (blockHasBottomPadding) {
context.report(node, node.loc.end, NEVER_MESSAGE);
context.report({
node: node,
loc: {line: node.loc.end.line, column: node.loc.end.column - 1 },
message: NEVER_MESSAGE
});
}
}
}
@@ -62,7 +62,7 @@ ruleTester.run("padded-blocks", rule, {
{
message: ALWAYS_MESSAGE,
line: 5,
column: 2
column: 1
}
]
},
@@ -72,7 +72,7 @@ ruleTester.run("padded-blocks", rule, {
{
message: ALWAYS_MESSAGE,
line: 5,
column: 2
column: 1
}
]
},

0 comments on commit 7f058f3

Please sign in to comment.
You can’t perform that action at this time.