diff --git a/javascript/packages/linter/src/rules/html-no-self-closing.ts b/javascript/packages/linter/src/rules/html-no-self-closing.ts index 7a1dd45be..2dcccf9d4 100644 --- a/javascript/packages/linter/src/rules/html-no-self-closing.ts +++ b/javascript/packages/linter/src/rules/html-no-self-closing.ts @@ -27,7 +27,7 @@ class NoSelfClosingVisitor extends BaseRuleVisitor this.addOffense( `Use \`${instead}\` instead of self-closing \`<${tagName} />\` for HTML compatibility.`, - node.location, + node.tag_closing.location, { node, tagName, diff --git a/javascript/packages/linter/test/__snapshots__/cli.test.ts.snap b/javascript/packages/linter/test/__snapshots__/cli.test.ts.snap index 1fc729ba8..69498b370 100644 --- a/javascript/packages/linter/test/__snapshots__/cli.test.ts.snap +++ b/javascript/packages/linter/test/__snapshots__/cli.test.ts.snap @@ -562,12 +562,12 @@ test/fixtures/multiple-rule-offenses.html.erb:10:4 [error] Use \`\` instead of self-closing \`\` for HTML compatibility. (html-no-self-closing) [Correctable] -test/fixtures/multiple-rule-offenses.html.erb:4:2 +test/fixtures/multiple-rule-offenses.html.erb:4:7 2 │ 3 │
→ 4 │ - │ ~~~~~~~ + │ ~~ 5 │ Link 1 6 │