@@ -135,55 +135,72 @@ ruleTester.run('template-no-unknown-arguments-for-builtin-components', rule, {
135135 errors : [ { messageId : 'conflictArgument' } , { messageId : 'conflictArgument' } ] ,
136136 } ,
137137 {
138+ // Deprecated argument without a replacement attribute — autofixed by removal.
138139 code : '<template><LinkTo @route="info" @model={{this.model}} @tagName="button" /></template>' ,
139- output : null ,
140+ output : '<template><LinkTo @route="info" @model={{this.model}} /></template>' ,
140141 errors : [ { messageId : 'unknownArgument' } ] ,
141142 } ,
142143 {
144+ // Deprecated argument with replacement — autofixed by renaming to the HTML attribute.
143145 code : '<template><LinkTo @route="info" @model={{this.model}} @elementId="superstar" /></template>' ,
144- output : null ,
146+ output : '<template><LinkTo @route="info" @model={{this.model}} id="superstar" /></template>' ,
145147 errors : [ { messageId : 'unknownArgument' } ] ,
146148 } ,
147149 {
150+ // Deprecated event with a helper invocation value — migrated to an `{{on}}` modifier with the helper as a sub-expression.
148151 code : '<template><LinkTo @route="info" @model={{this.model}} @doubleClick={{action this.click}} /></template>' ,
149- output : null ,
152+ output :
153+ '<template><LinkTo @route="info" @model={{this.model}} {{on "dblclick" (action this.click)}} /></template>' ,
150154 errors : [ { messageId : 'unknownArgument' } ] ,
151155 } ,
152156 {
157+ // Deprecated argument without a replacement attribute — autofixed by removal.
153158 code : '<template><Input @value="1" @bubbles={{false}} /></template>' ,
154- output : null ,
159+ output : '<template><Input @value="1" /></template>' ,
155160 errors : [ { messageId : 'unknownArgument' } ] ,
156161 } ,
157162 {
163+ // Two deprecated arguments on Input — both renamed to HTML attributes.
158164 code : '<template><Input @value="1" @elementId="42" @disabled="disabled" /></template>' ,
159- output : null ,
165+ output : '<template><Input @value="1" id="42" disabled="disabled" /></template>' ,
160166 errors : [ { messageId : 'unknownArgument' } , { messageId : 'unknownArgument' } ] ,
161167 } ,
162168 {
169+ // Deprecated event with a simple path value — migrated to an `{{on}}` modifier.
163170 code : '<template><Input @value="1" @key-up={{ths.onKeyUp}} /></template>' ,
164- output : null ,
171+ output : '<template><Input @value="1" {{on "keyup" ths.onKeyUp}} /></template>' ,
165172 errors : [ { messageId : 'unknownArgument' } ] ,
166173 } ,
167174 {
175+ // Deprecated argument without a replacement attribute — autofixed by removal.
168176 code : '<template><Textarea @value="1" @bubbles={{false}} /></template>' ,
169- output : null ,
177+ output : '<template><Textarea @value="1" /></template>' ,
170178 errors : [ { messageId : 'unknownArgument' } ] ,
171179 } ,
172180 {
181+ // Deprecated argument with replacement — autofixed by renaming to the HTML attribute.
173182 code : '<template><Textarea @value="1" @elementId="42" /></template>' ,
174- output : null ,
183+ output : '<template><Textarea @value="1" id="42" /></template>' ,
175184 errors : [ { messageId : 'unknownArgument' } ] ,
176185 } ,
177186 {
187+ // Deprecated event with a simple path value — migrated to an `{{on}}` modifier.
178188 code : '<template><Textarea @value="1" @key-up={{ths.onKeyUp}} /></template>' ,
179- output : null ,
189+ output : '<template><Textarea @value="1" {{on "keyup" ths.onKeyUp}} /></template>' ,
180190 errors : [ { messageId : 'unknownArgument' } ] ,
181191 } ,
182192 {
193+ // Truly unknown/typo argument — not autofixed.
183194 code : '<template> <LinkTo class="auk-search-results-list__item" @route={{@route}} @models={{this.models}} @random="test" @query={{@query}} ...attributes >Hello</LinkTo></template>' ,
184195 output : null ,
185196 errors : [ { messageId : 'unknownArgument' } ] ,
186197 } ,
198+ {
199+ // Deprecated event with a string-literal value — cannot migrate to `{{on}}`, so no autofix.
200+ code : '<template><Input @value="1" @click="noop" /></template>' ,
201+ output : null ,
202+ errors : [ { messageId : 'unknownArgument' } ] ,
203+ } ,
187204
188205 // Missing required arguments
189206 {
@@ -271,12 +288,12 @@ hbsRuleTester.run('template-no-unknown-arguments-for-builtin-components', rule,
271288 } ,
272289 {
273290 code : '<LinkTo @route="info" @model={{this.model}} @tagName="button" />' ,
274- output : null ,
291+ output : '<LinkTo @route="info" @model={{this.model}} />' ,
275292 errors : [ { message : 'Passing the "@tagName" argument to <LinkTo /> is deprecated.' } ] ,
276293 } ,
277294 {
278295 code : '<LinkTo @route="info" @model={{this.model}} @elementId="superstar" />' ,
279- output : null ,
296+ output : '<LinkTo @route="info" @model={{this.model}} id="superstar" />' ,
280297 errors : [
281298 {
282299 message : `Passing the "@elementId" argument to <LinkTo /> is deprecated.
@@ -286,7 +303,7 @@ Instead, please pass the attribute directly, i.e. "<LinkTo id={{...}} />" instea
286303 } ,
287304 {
288305 code : '<LinkTo @route="info" @model={{this.model}} @doubleClick={{action this.click}} />' ,
289- output : null ,
306+ output : '<LinkTo @route="info" @model={{this.model}} {{on "dblclick" (action this.click)}} />' ,
290307 errors : [
291308 {
292309 message : `Passing the "@doubleClick" argument to <LinkTo /> is deprecated.
@@ -296,12 +313,12 @@ Instead, please use the {{on}} modifier, i.e. "<LinkTo {{on "dblclick" ...}} />"
296313 } ,
297314 {
298315 code : '<Input @value="1" @bubbles={{false}} />' ,
299- output : null ,
316+ output : '<Input @value="1" />' ,
300317 errors : [ { message : 'Passing the "@bubbles" argument to <Input /> is deprecated.' } ] ,
301318 } ,
302319 {
303320 code : '<Input @value="1" @elementId="42" @disabled="disabled" />' ,
304- output : null ,
321+ output : '<Input @value="1" id="42" disabled="disabled" />' ,
305322 errors : [
306323 {
307324 message : `Passing the "@elementId" argument to <Input /> is deprecated.
@@ -315,7 +332,7 @@ Instead, please pass the attribute directly, i.e. "<Input disabled={{...}} />" i
315332 } ,
316333 {
317334 code : '<Input @value="1" @key-up={{ths.onKeyUp}} />' ,
318- output : null ,
335+ output : '<Input @value="1" {{on "keyup" ths.onKeyUp}} />' ,
319336 errors : [
320337 {
321338 message : `Passing the "@key-up" argument to <Input /> is deprecated.
@@ -325,12 +342,12 @@ Instead, please use the {{on}} modifier, i.e. "<Input {{on "keyup" ...}} />" ins
325342 } ,
326343 {
327344 code : '<Textarea @value="1" @bubbles={{false}} />' ,
328- output : null ,
345+ output : '<Textarea @value="1" />' ,
329346 errors : [ { message : 'Passing the "@bubbles" argument to <Textarea /> is deprecated.' } ] ,
330347 } ,
331348 {
332349 code : '<Textarea @value="1" @elementId="42" />' ,
333- output : null ,
350+ output : '<Textarea @value="1" id="42" />' ,
334351 errors : [
335352 {
336353 message : `Passing the "@elementId" argument to <Textarea /> is deprecated.
@@ -340,7 +357,7 @@ Instead, please pass the attribute directly, i.e. "<Textarea id={{...}} />" inst
340357 } ,
341358 {
342359 code : '<Textarea @value="1" @key-up={{ths.onKeyUp}} />' ,
343- output : null ,
360+ output : '<Textarea @value="1" {{on "keyup" ths.onKeyUp}} />' ,
344361 errors : [
345362 {
346363 message : `Passing the "@key-up" argument to <Textarea /> is deprecated.
0 commit comments