From 050d2bf07c1258db08b0000b869ba81079d6e8b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Johan=20R=C3=B8ed?= Date: Sun, 12 Apr 2026 07:03:12 +0200 Subject: [PATCH 1/6] fix(template-no-passed-in-event-handlers): align event list and ignore config with upstream - Remove mouseMove, mouseEnter, mouseLeave from event list (not in upstream) - Use bare names (without @) in ignore config for angle bracket invocations - Remove unnecessary PascalCase gate on ElementNode visitor --- .../template-no-passed-in-event-handlers.js | 20 +++++--- .../template-no-passed-in-event-handlers.js | 47 +++++++++++++------ 2 files changed, 45 insertions(+), 22 deletions(-) diff --git a/lib/rules/template-no-passed-in-event-handlers.js b/lib/rules/template-no-passed-in-event-handlers.js index 7904b32a3b..7f65ffa72e 100644 --- a/lib/rules/template-no-passed-in-event-handlers.js +++ b/lib/rules/template-no-passed-in-event-handlers.js @@ -12,9 +12,6 @@ const EMBER_EVENTS = new Set([ 'contextMenu', 'click', 'doubleClick', - 'mouseMove', - 'mouseEnter', - 'mouseLeave', 'focusIn', 'focusOut', 'submit', @@ -77,10 +74,19 @@ module.exports = { return { GlimmerElementNode(node) { - // Only check component invocations (PascalCase) - if (!/^[A-Z]/.test(node.tag)) { + // Only check component invocations. In GTS, dashed tags like + // are HTML (imports can't have dashes); lowercase non-dashed tags are + // HTML. Components are PascalCase, @-prefixed args, this.-prefixed + // references, or dot-paths (re-exports). + const isComponent = + /^[A-Z]/.test(node.tag) || + node.tag.startsWith('@') || + node.tag.startsWith('this.') || + node.tag.includes('.'); + if (!isComponent) { return; } + // Skip built-in Input/Textarea if (node.tag === 'Input' || node.tag === 'Textarea') { return; @@ -98,8 +104,8 @@ module.exports = { } const argName = attr.name.slice(1); - // Check ignore config - if (ignoredAttrs.includes(attr.name)) { + // Check ignore config (use bare name without @) + if (ignoredAttrs.includes(argName)) { continue; } diff --git a/tests/lib/rules/template-no-passed-in-event-handlers.js b/tests/lib/rules/template-no-passed-in-event-handlers.js index 6db6d73b51..225efdf733 100644 --- a/tests/lib/rules/template-no-passed-in-event-handlers.js +++ b/tests/lib/rules/template-no-passed-in-event-handlers.js @@ -35,6 +35,15 @@ ruleTester.run('template-no-passed-in-event-handlers', rule, { '', '', '