@@ -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,8 @@ 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 :
307+ '<LinkTo @route="info" @model={{this.model}} {{on "dblclick" (action this.click)}} />' ,
290308 errors : [
291309 {
292310 message : `Passing the "@doubleClick" argument to <LinkTo /> is deprecated.
@@ -296,12 +314,12 @@ Instead, please use the {{on}} modifier, i.e. "<LinkTo {{on "dblclick" ...}} />"
296314 } ,
297315 {
298316 code : '<Input @value="1" @bubbles={{false}} />' ,
299- output : null ,
317+ output : '<Input @value="1" />' ,
300318 errors : [ { message : 'Passing the "@bubbles" argument to <Input /> is deprecated.' } ] ,
301319 } ,
302320 {
303321 code : '<Input @value="1" @elementId="42" @disabled="disabled" />' ,
304- output : null ,
322+ output : '<Input @value="1" id="42" disabled="disabled" />' ,
305323 errors : [
306324 {
307325 message : `Passing the "@elementId" argument to <Input /> is deprecated.
@@ -315,7 +333,7 @@ Instead, please pass the attribute directly, i.e. "<Input disabled={{...}} />" i
315333 } ,
316334 {
317335 code : '<Input @value="1" @key-up={{ths.onKeyUp}} />' ,
318- output : null ,
336+ output : '<Input @value="1" {{on "keyup" ths.onKeyUp}} />' ,
319337 errors : [
320338 {
321339 message : `Passing the "@key-up" argument to <Input /> is deprecated.
@@ -325,12 +343,12 @@ Instead, please use the {{on}} modifier, i.e. "<Input {{on "keyup" ...}} />" ins
325343 } ,
326344 {
327345 code : '<Textarea @value="1" @bubbles={{false}} />' ,
328- output : null ,
346+ output : '<Textarea @value="1" />' ,
329347 errors : [ { message : 'Passing the "@bubbles" argument to <Textarea /> is deprecated.' } ] ,
330348 } ,
331349 {
332350 code : '<Textarea @value="1" @elementId="42" />' ,
333- output : null ,
351+ output : '<Textarea @value="1" id="42" />' ,
334352 errors : [
335353 {
336354 message : `Passing the "@elementId" argument to <Textarea /> is deprecated.
@@ -340,7 +358,7 @@ Instead, please pass the attribute directly, i.e. "<Textarea id={{...}} />" inst
340358 } ,
341359 {
342360 code : '<Textarea @value="1" @key-up={{ths.onKeyUp}} />' ,
343- output : null ,
361+ output : '<Textarea @value="1" {{on "keyup" ths.onKeyUp}} />' ,
344362 errors : [
345363 {
346364 message : `Passing the "@key-up" argument to <Textarea /> is deprecated.
0 commit comments