@@ -24,42 +24,44 @@ ruleTester.run('template-deprecated-inline-view-helper', rule, {
2424 '<template>{{this.view}}</template>' ,
2525 '<template>{{@view}}</template>' ,
2626 '<template>{{#let this.prop as |view|}} {{view}} {{/let}}</template>' ,
27+ // isLocal: view is a block param, view.name should not be flagged
28+ '<template>{{#each items as |view|}} {{view.name}} {{/each}}</template>' ,
2729 ] ,
2830 invalid : [
2931 {
3032 code : '<template>{{view class="foo"}}</template>' ,
3133 output : null ,
3234 errors : [ { messageId : 'deprecated' } ] ,
3335 } ,
34-
3536 {
3637 code : "<template>{{view 'awful-fishsticks'}}</template>" ,
37- output : null ,
38+ output : '<template>{{awful-fishsticks}}</template>' ,
3839 errors : [ { messageId : 'deprecated' } ] ,
3940 } ,
4041 {
4142 code : '<template>{{view.bad-fishsticks}}</template>' ,
42- output : null ,
43+ output : '<template>{{bad-fishsticks}}</template>' ,
4344 errors : [ { messageId : 'deprecated' } ] ,
4445 } ,
4546 {
4647 code : '<template>{{view.terrible.fishsticks}}</template>' ,
47- output : null ,
48+ output : '<template>{{terrible.fishsticks}}</template>' ,
4849 errors : [ { messageId : 'deprecated' } ] ,
4950 } ,
5051 {
5152 code : '<template>{{foo-bar bab=good baz=view.qux.qaz boo=okay}}</template>' ,
52- output : null ,
53+ output : '<template>{{foo-bar bab=good baz=qux.qaz boo=okay}}</template>' ,
5354 errors : [ { messageId : 'deprecated' } ] ,
5455 } ,
5556 {
5657 code : '<template><div class="whatever-class" data-foo={{view.hallo}} sure=thing></div></template>' ,
57- output : null ,
58+ output :
59+ '<template><div class="whatever-class" data-foo={{hallo}} sure=thing></div></template>' ,
5860 errors : [ { messageId : 'deprecated' } ] ,
5961 } ,
6062 {
6163 code : '<template>{{#foo-bar derp=view.whoops thing=whatever}}{{/foo-bar}}</template>' ,
62- output : null ,
64+ output : '<template>{{#foo-bar derp=whoops thing=whatever}}{{/foo-bar}}</template>' ,
6365 errors : [ { messageId : 'deprecated' } ] ,
6466 } ,
6567 ] ,
@@ -89,11 +91,13 @@ hbsRuleTester.run('template-deprecated-inline-view-helper', rule, {
8991 '{{this.view}}' ,
9092 '{{@view}}' ,
9193 '{{#let this.prop as |view|}} {{view}} {{/let}}' ,
94+ // isLocal: view is a block param, view.name should not be flagged
95+ '{{#each items as |view|}} {{view.name}} {{/each}}' ,
9296 ] ,
9397 invalid : [
9498 {
9599 code : "{{view 'awful-fishsticks'}}" ,
96- output : null ,
100+ output : '{{awful-fishsticks}}' ,
97101 errors : [
98102 {
99103 message :
@@ -103,7 +107,7 @@ hbsRuleTester.run('template-deprecated-inline-view-helper', rule, {
103107 } ,
104108 {
105109 code : '{{view.bad-fishsticks}}' ,
106- output : null ,
110+ output : '{{bad-fishsticks}}' ,
107111 errors : [
108112 {
109113 message :
@@ -113,7 +117,7 @@ hbsRuleTester.run('template-deprecated-inline-view-helper', rule, {
113117 } ,
114118 {
115119 code : '{{view.terrible.fishsticks}}' ,
116- output : null ,
120+ output : '{{terrible.fishsticks}}' ,
117121 errors : [
118122 {
119123 message :
@@ -123,7 +127,7 @@ hbsRuleTester.run('template-deprecated-inline-view-helper', rule, {
123127 } ,
124128 {
125129 code : '{{foo-bar bab=good baz=view.qux.qaz boo=okay}}' ,
126- output : null ,
130+ output : '{{foo-bar bab=good baz=qux.qaz boo=okay}}' ,
127131 errors : [
128132 {
129133 message :
@@ -133,7 +137,7 @@ hbsRuleTester.run('template-deprecated-inline-view-helper', rule, {
133137 } ,
134138 {
135139 code : '<div class="whatever-class" data-foo={{view.hallo}} sure=thing></div>' ,
136- output : null ,
140+ output : '<div class="whatever-class" data-foo={{hallo}} sure=thing></div>' ,
137141 errors : [
138142 {
139143 message :
@@ -143,7 +147,7 @@ hbsRuleTester.run('template-deprecated-inline-view-helper', rule, {
143147 } ,
144148 {
145149 code : '{{#foo-bar derp=view.whoops thing=whatever}}{{/foo-bar}}' ,
146- output : null ,
150+ output : '{{#foo-bar derp=whoops thing=whatever}}{{/foo-bar}}' ,
147151 errors : [
148152 {
149153 message :
0 commit comments