Skip to content
Permalink
Browse files

Update: improve report location for space-infix-ops (#12324)

  • Loading branch information
golopot authored and kaicataldo committed Nov 1, 2019
1 parent 94ff921 commit 7e41355b19a8ef347620dd7c0dde491c3460937b
Showing with 27 additions and 14 deletions.
  1. +1 −1 lib/rules/space-infix-ops.js
  2. +26 −13 tests/lib/rules/space-infix-ops.js
@@ -69,7 +69,7 @@ module.exports = {
function report(mainNode, culpritToken) {
context.report({
node: mainNode,
loc: culpritToken.loc.start,
loc: culpritToken.loc,
message: "Operator '{{operator}}' must be spaced.",
data: {
operator: culpritToken.value
@@ -57,7 +57,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '+' must be spaced.",
type: "BinaryExpression",
line: 1,
column: 2
column: 2,
endColumn: 3
}]
},
{
@@ -67,7 +68,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '+' must be spaced.",
type: "BinaryExpression",
line: 1,
column: 3
column: 3,
endColumn: 4
}]
},
{
@@ -77,7 +79,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '+' must be spaced.",
type: "BinaryExpression",
line: 1,
column: 2
column: 2,
endColumn: 3
}]
},
{
@@ -87,7 +90,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '||' must be spaced.",
type: "LogicalExpression",
line: 1,
column: 2
column: 2,
endColumn: 4
}]
},
{
@@ -97,7 +101,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '||' must be spaced.",
type: "LogicalExpression",
line: 1,
column: 3
column: 3,
endColumn: 5
}]
},
{
@@ -107,7 +112,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '||' must be spaced.",
type: "LogicalExpression",
line: 1,
column: 2
column: 2,
endColumn: 4
}]
},
{
@@ -147,7 +153,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '?' must be spaced.",
type: "ConditionalExpression",
line: 1,
column: 2
column: 2,
endColumn: 3
}]
},
{
@@ -157,7 +164,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '?' must be spaced.",
type: "ConditionalExpression",
line: 1,
column: 2
column: 2,
endColumn: 3
}]
},
{
@@ -167,7 +175,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator ':' must be spaced.",
type: "ConditionalExpression",
line: 1,
column: 6
column: 6,
endColumn: 7
}]
},
{
@@ -177,7 +186,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '?' must be spaced.",
type: "ConditionalExpression",
line: 1,
column: 2
column: 2,
endColumn: 3
}]
},
{
@@ -187,7 +197,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator '?' must be spaced.",
type: "ConditionalExpression",
line: 1,
column: 3
column: 3,
endColumn: 4
}]
},
{
@@ -197,7 +208,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator ':' must be spaced.",
type: "ConditionalExpression",
line: 1,
column: 6
column: 6,
endColumn: 7
}]
},
{
@@ -207,7 +219,8 @@ ruleTester.run("space-infix-ops", rule, {
message: "Operator ':' must be spaced.",
type: "ConditionalExpression",
line: 1,
column: 7
column: 7,
endColumn: 8
}]
},
{

0 comments on commit 7e41355

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