@@ -370,11 +370,12 @@ ruleTester.run('no-mutating-props', rule, {
370
370
<div v-if="this.prop6++ && this.someProp < 10"></div>
371
371
<div v-text="this.prop7.shift()"></div>
372
372
<div v-text="this.prop8.slice(0).shift()"></div>
373
+ <div v-if="delete prop9.a"></div>
373
374
</div>
374
375
</template>
375
376
<script>
376
377
export default {
377
- props: ['prop1', 'prop2', 'prop3', 'prop4', 'prop5', 'prop6', 'prop7', 'prop8']
378
+ props: ['prop1', 'prop2', 'prop3', 'prop4', 'prop5', 'prop6', 'prop7', 'prop8', 'prop9' ]
378
379
}
379
380
</script>
380
381
` ,
@@ -402,6 +403,10 @@ ruleTester.run('no-mutating-props', rule, {
402
403
{
403
404
message : 'Unexpected mutation of "prop7" prop.' ,
404
405
line : 10
406
+ } ,
407
+ {
408
+ message : 'Unexpected mutation of "prop9" prop.' ,
409
+ line : 12
405
410
}
406
411
]
407
412
} ,
@@ -507,6 +512,7 @@ ruleTester.run('no-mutating-props', rule, {
507
512
++this.items
508
513
this.todo.type = 'completed'
509
514
this.items.push('something')
515
+ delete this.todo.type
510
516
}
511
517
}
512
518
}
@@ -524,6 +530,10 @@ ruleTester.run('no-mutating-props', rule, {
524
530
{
525
531
message : 'Unexpected mutation of "items" prop.' ,
526
532
line : 18
533
+ } ,
534
+ {
535
+ message : 'Unexpected mutation of "todo" prop.' ,
536
+ line : 19
527
537
}
528
538
]
529
539
} ,
@@ -651,6 +661,7 @@ ruleTester.run('no-mutating-props', rule, {
651
661
props.a ++
652
662
props.b = 1
653
663
props.c.push(1)
664
+ delete props.d
654
665
}
655
666
}
656
667
</script>
@@ -667,6 +678,10 @@ ruleTester.run('no-mutating-props', rule, {
667
678
{
668
679
message : 'Unexpected mutation of "c" prop.' ,
669
680
line : 7
681
+ } ,
682
+ {
683
+ message : 'Unexpected mutation of "d" prop.' ,
684
+ line : 8
670
685
}
671
686
]
672
687
} ,
@@ -681,6 +696,7 @@ ruleTester.run('no-mutating-props', rule, {
681
696
c.push(1)
682
697
683
698
c.x.push(1)
699
+ delete c.y
684
700
e.foo++
685
701
f.foo++
686
702
}
@@ -705,12 +721,16 @@ ruleTester.run('no-mutating-props', rule, {
705
721
line : 9
706
722
} ,
707
723
{
708
- message : 'Unexpected mutation of "d " prop.' ,
724
+ message : 'Unexpected mutation of "c " prop.' ,
709
725
line : 10
710
726
} ,
711
727
{
712
728
message : 'Unexpected mutation of "d" prop.' ,
713
729
line : 11
730
+ } ,
731
+ {
732
+ message : 'Unexpected mutation of "d" prop.' ,
733
+ line : 12
714
734
}
715
735
]
716
736
} ,
@@ -722,6 +742,7 @@ ruleTester.run('no-mutating-props', rule, {
722
742
export default {
723
743
setup({a: foo, b: [...bar], c: baz = 1}) {
724
744
foo.x ++
745
+ delete foo.y
725
746
bar.x = 1
726
747
baz.push(1)
727
748
}
@@ -734,12 +755,16 @@ ruleTester.run('no-mutating-props', rule, {
734
755
line : 5
735
756
} ,
736
757
{
737
- message : 'Unexpected mutation of "b " prop.' ,
758
+ message : 'Unexpected mutation of "a " prop.' ,
738
759
line : 6
739
760
} ,
740
761
{
741
- message : 'Unexpected mutation of "c " prop.' ,
762
+ message : 'Unexpected mutation of "b " prop.' ,
742
763
line : 7
764
+ } ,
765
+ {
766
+ message : 'Unexpected mutation of "c" prop.' ,
767
+ line : 8
743
768
}
744
769
]
745
770
} ,
@@ -752,6 +777,7 @@ ruleTester.run('no-mutating-props', rule, {
752
777
props.a ++
753
778
props.b = 1
754
779
props.c.push(1)
780
+ delete props.d
755
781
}
756
782
}
757
783
</script>
@@ -768,6 +794,10 @@ ruleTester.run('no-mutating-props', rule, {
768
794
{
769
795
message : 'Unexpected mutation of "c" prop.' ,
770
796
line : 7
797
+ } ,
798
+ {
799
+ message : 'Unexpected mutation of "d" prop.' ,
800
+ line : 8
771
801
}
772
802
]
773
803
} ,
0 commit comments