Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Update: Improve report location for template-tag-spacing (refs #12334) (
#13203)

* Update: Improve report location for template-tag-spacing (refs #12334)

* Change always
  • Loading branch information
mdjermanovic committed Jun 1, 2020
1 parent 578efad commit b76aef7
Show file tree
Hide file tree
Showing 2 changed files with 283 additions and 33 deletions.
10 changes: 8 additions & 2 deletions lib/rules/template-tag-spacing.js
Expand Up @@ -49,7 +49,10 @@ module.exports = {
if (never && hasWhitespace) {
context.report({
node,
loc: tagToken.loc.start,
loc: {
start: tagToken.loc.end,
end: literalToken.loc.start
},
messageId: "unexpected",
fix(fixer) {
const comments = sourceCode.getCommentsBefore(node.quasi);
Expand All @@ -68,7 +71,10 @@ module.exports = {
} else if (!never && !hasWhitespace) {
context.report({
node,
loc: tagToken.loc.start,
loc: {
start: node.loc.start,
end: literalToken.loc.start
},
messageId: "missing",
fix(fixer) {
return fixer.insertTextAfter(tagToken, " ");
Expand Down

0 comments on commit b76aef7

Please sign in to comment.