Skip to content

Commit

Permalink
Fix: improve report location for computed-property-spacing (#12795)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic authored and kaicataldo committed Jan 17, 2020
1 parent 756b95d commit 0d8c0af
Show file tree
Hide file tree
Showing 2 changed files with 398 additions and 128 deletions.
8 changes: 4 additions & 4 deletions lib/rules/computed-property-spacing.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ module.exports = {
function reportNoBeginningSpace(node, token, tokenAfter) {
context.report({
node,
loc: token.loc.start,
loc: { start: token.loc.end, end: tokenAfter.loc.start },
messageId: "unexpectedSpaceAfter",
data: {
tokenValue: token.value
Expand All @@ -88,7 +88,7 @@ module.exports = {
function reportNoEndingSpace(node, token, tokenBefore) {
context.report({
node,
loc: token.loc.start,
loc: { start: tokenBefore.loc.end, end: token.loc.start },
messageId: "unexpectedSpaceBefore",
data: {
tokenValue: token.value
Expand All @@ -108,7 +108,7 @@ module.exports = {
function reportRequiredBeginningSpace(node, token) {
context.report({
node,
loc: token.loc.start,
loc: token.loc,
messageId: "missingSpaceAfter",
data: {
tokenValue: token.value
Expand All @@ -128,7 +128,7 @@ module.exports = {
function reportRequiredEndingSpace(node, token) {
context.report({
node,
loc: token.loc.start,
loc: token.loc,
messageId: "missingSpaceBefore",
data: {
tokenValue: token.value
Expand Down
Loading

0 comments on commit 0d8c0af

Please sign in to comment.