@@ -35,6 +35,15 @@ ruleTester.run('template-no-passed-in-event-handlers', rule, {
3535 '<template><Foo @random={{true}} /></template>' ,
3636 '<template><Input @click={{this.handleClick}} /></template>' ,
3737 '<template><Textarea @click={{this.handleClick}} /></template>' ,
38+
39+ // HTML elements are not checked (in GTS <my-button> is HTML, not a component)
40+ '<template><my-button @click={{this.handleClick}} /></template>' ,
41+ '<template><custom-el @submit={{this.handleSubmit}} /></template>' ,
42+
43+ // mouseMove/mouseEnter/mouseLeave are NOT in upstream's event list
44+ '<template><Foo @mouseMove={{this.handleMove}} /></template>' ,
45+ '<template><Foo @mouseEnter={{this.handleEnter}} /></template>' ,
46+ '<template><Foo @mouseLeave={{this.handleLeave}} /></template>' ,
3847 '<template>{{foo}}</template>' ,
3948 '<template>{{foo onClick=this.handleClick}}</template>' ,
4049 '<template>{{foo onclick=this.handleClick}}</template>' ,
@@ -48,11 +57,11 @@ ruleTester.run('template-no-passed-in-event-handlers', rule, {
4857 // ignore option — angle bracket invocation
4958 {
5059 code : '<template><Foo @click={{this.handleClick}} /></template>' ,
51- options : [ { ignore : { Foo : [ '@ click' ] } } ] ,
60+ options : [ { ignore : { Foo : [ 'click' ] } } ] ,
5261 } ,
5362 {
5463 code : '<template><Foo @click={{this.handleClick}} @submit={{this.handleSubmit}} /></template>' ,
55- options : [ { ignore : { Foo : [ '@ click' , '@ submit' ] } } ] ,
64+ options : [ { ignore : { Foo : [ 'click' , 'submit' ] } } ] ,
5665 } ,
5766
5867 // ignore option — curly invocation
@@ -82,25 +91,33 @@ ruleTester.run('template-no-passed-in-event-handlers', rule, {
8291 errors : [ { messageId : 'unexpected' } ] ,
8392 } ,
8493 {
85- code : `<template>
86- <CustomButton @mouseEnter={{this.handleHover}} />
87- </template>` ,
94+ code : '<template><Foo @click={{this.handleClick}} /></template>' ,
8895 output : null ,
8996 errors : [ { messageId : 'unexpected' } ] ,
9097 } ,
91-
9298 {
93- code : '<template><Foo @click ={{this.handleClick}} /></template>' ,
99+ code : '<template><Foo @keyPress ={{this.handleClick}} /></template>' ,
94100 output : null ,
95101 errors : [ { messageId : 'unexpected' } ] ,
96102 } ,
97103 {
98- code : '<template><Foo @keyPress ={{this.handleClick}} /></template>' ,
104+ code : '<template><Foo @submit ={{this.handleClick}} /></template>' ,
99105 output : null ,
100106 errors : [ { messageId : 'unexpected' } ] ,
101107 } ,
108+ // Non-PascalCase component forms: this.-prefixed, @-prefixed, dot-path
102109 {
103- code : '<template><Foo @submit={{this.handleClick}} /></template>' ,
110+ code : '<template><this.MyComponent @click={{this.handleClick}} /></template>' ,
111+ output : null ,
112+ errors : [ { messageId : 'unexpected' } ] ,
113+ } ,
114+ {
115+ code : '<template><@someComponent @click={{this.handleClick}} /></template>' ,
116+ output : null ,
117+ errors : [ { messageId : 'unexpected' } ] ,
118+ } ,
119+ {
120+ code : '<template><ns.Widget @submit={{this.handleSubmit}} /></template>' ,
104121 output : null ,
105122 errors : [ { messageId : 'unexpected' } ] ,
106123 } ,
@@ -124,14 +141,14 @@ ruleTester.run('template-no-passed-in-event-handlers', rule, {
124141 {
125142 code : '<template><Bar @click={{this.handleClick}} /></template>' ,
126143 output : null ,
127- options : [ { ignore : { Foo : [ '@ click' ] } } ] ,
144+ options : [ { ignore : { Foo : [ 'click' ] } } ] ,
128145 errors : [ { messageId : 'unexpected' } ] ,
129146 } ,
130147 // ignore option — only ignores specified attrs (angle bracket)
131148 {
132149 code : '<template><Foo @submit={{this.handleSubmit}} /></template>' ,
133150 output : null ,
134- options : [ { ignore : { Foo : [ '@ click' ] } } ] ,
151+ options : [ { ignore : { Foo : [ 'click' ] } } ] ,
135152 errors : [ { messageId : 'unexpected' } ] ,
136153 } ,
137154 // ignore option — only ignores specified component (curly)
@@ -183,11 +200,11 @@ hbsRuleTester.run('template-no-passed-in-event-handlers', rule, {
183200 // ignore option — angle bracket invocation
184201 {
185202 code : '<Foo @click={{this.handleClick}} />' ,
186- options : [ { ignore : { Foo : [ '@ click' ] } } ] ,
203+ options : [ { ignore : { Foo : [ 'click' ] } } ] ,
187204 } ,
188205 {
189206 code : '<Foo @click={{this.handleClick}} @submit={{this.handleSubmit}} />' ,
190- options : [ { ignore : { Foo : [ '@ click' , '@ submit' ] } } ] ,
207+ options : [ { ignore : { Foo : [ 'click' , 'submit' ] } } ] ,
191208 } ,
192209
193210 // ignore option — curly invocation
@@ -266,14 +283,14 @@ hbsRuleTester.run('template-no-passed-in-event-handlers', rule, {
266283 {
267284 code : '<Bar @click={{this.handleClick}} />' ,
268285 output : null ,
269- options : [ { ignore : { Foo : [ '@ click' ] } } ] ,
286+ options : [ { ignore : { Foo : [ 'click' ] } } ] ,
270287 errors : [ { messageId : 'unexpected' } ] ,
271288 } ,
272289 // ignore option — only ignores specified attrs (angle bracket)
273290 {
274291 code : '<Foo @submit={{this.handleSubmit}} />' ,
275292 output : null ,
276- options : [ { ignore : { Foo : [ '@ click' ] } } ] ,
293+ options : [ { ignore : { Foo : [ 'click' ] } } ] ,
277294 errors : [ { messageId : 'unexpected' } ] ,
278295 } ,
279296 // ignore option — only ignores specified component (curly)
0 commit comments