@neralabs/rerail-pack-vue 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2098 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "eslint-plugin-vue-no-setup-props-reactivity-loss",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Don't destructure Vue props or copy their values at the top level of setup() or script setup; the copies lose reactivity.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*.vue"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "shared",
16
+ "define": {
17
+ "language": "vue",
18
+ "utils": {
19
+ "barrier": {
20
+ "any": [
21
+ {
22
+ "kind": "function_expression"
23
+ },
24
+ {
25
+ "kind": "arrow_function"
26
+ },
27
+ {
28
+ "kind": "function_declaration"
29
+ },
30
+ {
31
+ "kind": "generator_function"
32
+ },
33
+ {
34
+ "kind": "generator_function_declaration"
35
+ },
36
+ {
37
+ "kind": "method_definition"
38
+ },
39
+ {
40
+ "kind": "class_declaration"
41
+ },
42
+ {
43
+ "kind": "class"
44
+ },
45
+ {
46
+ "kind": "class_static_block"
47
+ },
48
+ {
49
+ "kind": "for_statement"
50
+ },
51
+ {
52
+ "kind": "for_in_statement"
53
+ },
54
+ {
55
+ "kind": "switch_statement"
56
+ },
57
+ {
58
+ "kind": "catch_clause"
59
+ },
60
+ {
61
+ "kind": "statement_block",
62
+ "not": {
63
+ "inside": {
64
+ "any": [
65
+ {
66
+ "kind": "function_expression"
67
+ },
68
+ {
69
+ "kind": "arrow_function"
70
+ },
71
+ {
72
+ "kind": "function_declaration"
73
+ },
74
+ {
75
+ "kind": "generator_function"
76
+ },
77
+ {
78
+ "kind": "generator_function_declaration"
79
+ },
80
+ {
81
+ "kind": "method_definition"
82
+ }
83
+ ],
84
+ "field": "body"
85
+ }
86
+ }
87
+ }
88
+ ]
89
+ },
90
+ "vue-definition-call": {
91
+ "kind": "call_expression",
92
+ "has": {
93
+ "field": "function",
94
+ "any": [
95
+ {
96
+ "kind": "member_expression",
97
+ "all": [
98
+ {
99
+ "has": {
100
+ "field": "object",
101
+ "kind": "identifier",
102
+ "regex": "^Vue$"
103
+ }
104
+ },
105
+ {
106
+ "has": {
107
+ "field": "property",
108
+ "regex": "^(component|mixin|extend)$"
109
+ }
110
+ }
111
+ ]
112
+ },
113
+ {
114
+ "kind": "member_expression",
115
+ "all": [
116
+ {
117
+ "has": {
118
+ "field": "object",
119
+ "kind": "identifier"
120
+ }
121
+ },
122
+ {
123
+ "has": {
124
+ "field": "property",
125
+ "regex": "^(component|mixin)$"
126
+ }
127
+ }
128
+ ]
129
+ },
130
+ {
131
+ "kind": "identifier",
132
+ "regex": "^defineNuxtComponent$"
133
+ },
134
+ {
135
+ "kind": "identifier",
136
+ "regex": "^(component|createApp|defineComponent)$",
137
+ "not": {
138
+ "resolves": {
139
+ "binding": {
140
+ "site": {
141
+ "any": [
142
+ {
143
+ "kind": "import_specifier",
144
+ "not": {
145
+ "inside": {
146
+ "stopBy": "end",
147
+ "kind": "import_statement",
148
+ "has": {
149
+ "field": "source",
150
+ "regex": "^['\"](vue|@vue/composition-api|@nuxtjs/composition-api)['\"]$"
151
+ }
152
+ }
153
+ }
154
+ },
155
+ {
156
+ "kind": "function_declaration"
157
+ },
158
+ {
159
+ "kind": "class_declaration"
160
+ }
161
+ ]
162
+ }
163
+ }
164
+ }
165
+ }
166
+ }
167
+ ]
168
+ }
169
+ },
170
+ "vue-object": {
171
+ "kind": "object",
172
+ "any": [
173
+ {
174
+ "inside": {
175
+ "kind": "export_statement",
176
+ "field": "value"
177
+ }
178
+ },
179
+ {
180
+ "inside": {
181
+ "any": [
182
+ {
183
+ "kind": "as_expression"
184
+ },
185
+ {
186
+ "kind": "satisfies_expression"
187
+ }
188
+ ],
189
+ "inside": {
190
+ "kind": "export_statement",
191
+ "field": "value"
192
+ }
193
+ }
194
+ },
195
+ {
196
+ "nthChild": {
197
+ "position": 1,
198
+ "reverse": true,
199
+ "ofRule": {
200
+ "not": {
201
+ "kind": "comment"
202
+ }
203
+ }
204
+ },
205
+ "inside": {
206
+ "kind": "arguments",
207
+ "inside": {
208
+ "matches": "vue-definition-call"
209
+ }
210
+ }
211
+ },
212
+ {
213
+ "nthChild": {
214
+ "position": 1,
215
+ "ofRule": {
216
+ "not": {
217
+ "kind": "comment"
218
+ }
219
+ }
220
+ },
221
+ "inside": {
222
+ "kind": "arguments",
223
+ "inside": {
224
+ "kind": "new_expression",
225
+ "has": {
226
+ "field": "constructor",
227
+ "kind": "identifier",
228
+ "regex": "^Vue$"
229
+ }
230
+ }
231
+ }
232
+ }
233
+ ]
234
+ },
235
+ "setup-key": {
236
+ "any": [
237
+ {
238
+ "kind": "property_identifier",
239
+ "regex": "^setup$"
240
+ },
241
+ {
242
+ "kind": "string",
243
+ "has": {
244
+ "kind": "string_fragment",
245
+ "regex": "^setup$"
246
+ }
247
+ },
248
+ {
249
+ "kind": "computed_property_name",
250
+ "has": {
251
+ "stopBy": "neighbor",
252
+ "any": [
253
+ {
254
+ "kind": "string",
255
+ "has": {
256
+ "kind": "string_fragment",
257
+ "regex": "^setup$"
258
+ }
259
+ },
260
+ {
261
+ "kind": "template_string",
262
+ "regex": "^`setup`$"
263
+ }
264
+ ]
265
+ }
266
+ }
267
+ ]
268
+ },
269
+ "setup-fn": {
270
+ "any": [
271
+ {
272
+ "kind": "method_definition",
273
+ "all": [
274
+ {
275
+ "has": {
276
+ "field": "name",
277
+ "matches": "setup-key"
278
+ }
279
+ },
280
+ {
281
+ "inside": {
282
+ "matches": "vue-object"
283
+ }
284
+ }
285
+ ]
286
+ },
287
+ {
288
+ "any": [
289
+ {
290
+ "kind": "function_expression"
291
+ },
292
+ {
293
+ "kind": "arrow_function"
294
+ },
295
+ {
296
+ "kind": "generator_function"
297
+ }
298
+ ],
299
+ "inside": {
300
+ "field": "value",
301
+ "kind": "pair",
302
+ "all": [
303
+ {
304
+ "has": {
305
+ "field": "key",
306
+ "matches": "setup-key"
307
+ }
308
+ },
309
+ {
310
+ "inside": {
311
+ "matches": "vue-object"
312
+ }
313
+ }
314
+ ]
315
+ }
316
+ }
317
+ ]
318
+ },
319
+ "setup-fp": {
320
+ "kind": "formal_parameters",
321
+ "inside": {
322
+ "matches": "setup-fn"
323
+ }
324
+ },
325
+ "setup-param-slot": {
326
+ "any": [
327
+ {
328
+ "nthChild": {
329
+ "position": 1,
330
+ "ofRule": {
331
+ "not": {
332
+ "kind": "comment"
333
+ }
334
+ }
335
+ },
336
+ "inside": {
337
+ "matches": "setup-fp"
338
+ }
339
+ },
340
+ {
341
+ "inside": {
342
+ "kind": "assignment_pattern",
343
+ "field": "left",
344
+ "nthChild": {
345
+ "position": 1,
346
+ "ofRule": {
347
+ "not": {
348
+ "kind": "comment"
349
+ }
350
+ }
351
+ },
352
+ "inside": {
353
+ "matches": "setup-fp"
354
+ }
355
+ }
356
+ },
357
+ {
358
+ "inside": {
359
+ "any": [
360
+ {
361
+ "kind": "required_parameter"
362
+ },
363
+ {
364
+ "kind": "optional_parameter"
365
+ }
366
+ ],
367
+ "field": "pattern",
368
+ "nthChild": {
369
+ "position": 1,
370
+ "ofRule": {
371
+ "not": {
372
+ "kind": "comment"
373
+ }
374
+ }
375
+ },
376
+ "inside": {
377
+ "matches": "setup-fp"
378
+ }
379
+ }
380
+ },
381
+ {
382
+ "inside": {
383
+ "kind": "arrow_function",
384
+ "field": "parameter",
385
+ "matches": "setup-fn"
386
+ }
387
+ }
388
+ ]
389
+ },
390
+ "define-props-call": {
391
+ "kind": "call_expression",
392
+ "has": {
393
+ "field": "function",
394
+ "kind": "identifier",
395
+ "regex": "^defineProps$"
396
+ }
397
+ },
398
+ "define-props-ref": {
399
+ "any": [
400
+ {
401
+ "matches": "define-props-call"
402
+ },
403
+ {
404
+ "kind": "parenthesized_expression",
405
+ "has": {
406
+ "stopBy": "neighbor",
407
+ "matches": "define-props-ref"
408
+ }
409
+ }
410
+ ]
411
+ },
412
+ "macro-call": {
413
+ "any": [
414
+ {
415
+ "matches": "define-props-ref"
416
+ },
417
+ {
418
+ "kind": "call_expression",
419
+ "all": [
420
+ {
421
+ "has": {
422
+ "field": "function",
423
+ "kind": "identifier",
424
+ "regex": "^withDefaults$"
425
+ }
426
+ },
427
+ {
428
+ "has": {
429
+ "field": "arguments",
430
+ "has": {
431
+ "nthChild": {
432
+ "position": 1,
433
+ "ofRule": {
434
+ "not": {
435
+ "kind": "comment"
436
+ }
437
+ }
438
+ },
439
+ "matches": "define-props-ref"
440
+ }
441
+ }
442
+ }
443
+ ]
444
+ },
445
+ {
446
+ "kind": "parenthesized_expression",
447
+ "has": {
448
+ "stopBy": "neighbor",
449
+ "matches": "macro-call"
450
+ }
451
+ }
452
+ ]
453
+ },
454
+ "setup-decl": {
455
+ "kind": "variable_declarator",
456
+ "all": [
457
+ {
458
+ "has": {
459
+ "field": "value",
460
+ "matches": "macro-call"
461
+ }
462
+ },
463
+ {
464
+ "inside": {
465
+ "any": [
466
+ {
467
+ "kind": "lexical_declaration"
468
+ },
469
+ {
470
+ "kind": "variable_declaration"
471
+ }
472
+ ],
473
+ "inside": {
474
+ "kind": "program"
475
+ },
476
+ "follows": {
477
+ "stopBy": {
478
+ "kind": "empty_statement",
479
+ "host": {
480
+ "kind": "start_tag",
481
+ "regex": "^<script\\b"
482
+ }
483
+ },
484
+ "kind": "empty_statement",
485
+ "host": {
486
+ "kind": "start_tag",
487
+ "regex": "^<script(?:\\s+[^\\s\"'<>/=]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s\"'<>=`]+))?)*\\s+setup(?:[\\s/>=]|$)"
488
+ }
489
+ }
490
+ }
491
+ }
492
+ ]
493
+ },
494
+ "setup-object-pattern": {
495
+ "kind": "object_pattern",
496
+ "inside": {
497
+ "field": "name",
498
+ "matches": "setup-decl"
499
+ }
500
+ },
501
+ "write-position": {
502
+ "any": [
503
+ {
504
+ "inside": {
505
+ "any": [
506
+ {
507
+ "kind": "assignment_expression"
508
+ }
509
+ ],
510
+ "field": "left"
511
+ }
512
+ },
513
+ {
514
+ "inside": {
515
+ "kind": "pair_pattern",
516
+ "field": "value"
517
+ }
518
+ },
519
+ {
520
+ "inside": {
521
+ "kind": "for_in_statement",
522
+ "field": "left"
523
+ }
524
+ },
525
+ {
526
+ "inside": {
527
+ "kind": "array_pattern"
528
+ }
529
+ }
530
+ ]
531
+ },
532
+ "rhs-root": {
533
+ "any": [
534
+ {
535
+ "inside": {
536
+ "kind": "variable_declarator",
537
+ "field": "value"
538
+ }
539
+ },
540
+ {
541
+ "inside": {
542
+ "any": [
543
+ {
544
+ "kind": "assignment_expression"
545
+ },
546
+ {
547
+ "kind": "augmented_assignment_expression"
548
+ }
549
+ ],
550
+ "field": "right"
551
+ }
552
+ }
553
+ ]
554
+ },
555
+ "rhs-root-pattern": {
556
+ "any": [
557
+ {
558
+ "inside": {
559
+ "kind": "variable_declarator",
560
+ "field": "value",
561
+ "has": {
562
+ "field": "name",
563
+ "any": [
564
+ {
565
+ "kind": "object_pattern"
566
+ },
567
+ {
568
+ "kind": "array_pattern"
569
+ }
570
+ ]
571
+ }
572
+ }
573
+ },
574
+ {
575
+ "inside": {
576
+ "kind": "assignment_expression",
577
+ "field": "right",
578
+ "has": {
579
+ "field": "left",
580
+ "any": [
581
+ {
582
+ "kind": "object_pattern"
583
+ },
584
+ {
585
+ "kind": "array_pattern"
586
+ }
587
+ ]
588
+ }
589
+ }
590
+ }
591
+ ]
592
+ },
593
+ "chain-up": {
594
+ "any": [
595
+ {
596
+ "matches": "rhs-root"
597
+ },
598
+ {
599
+ "inside": {
600
+ "any": [
601
+ {
602
+ "kind": "member_expression"
603
+ },
604
+ {
605
+ "kind": "subscript_expression"
606
+ }
607
+ ],
608
+ "field": "object",
609
+ "matches": "chain-up"
610
+ }
611
+ },
612
+ {
613
+ "inside": {
614
+ "kind": "parenthesized_expression",
615
+ "matches": "chain-up"
616
+ }
617
+ }
618
+ ]
619
+ },
620
+ "chain-up-pattern": {
621
+ "any": [
622
+ {
623
+ "matches": "rhs-root-pattern"
624
+ },
625
+ {
626
+ "inside": {
627
+ "any": [
628
+ {
629
+ "kind": "member_expression"
630
+ },
631
+ {
632
+ "kind": "subscript_expression"
633
+ }
634
+ ],
635
+ "field": "object",
636
+ "matches": "chain-up-pattern"
637
+ }
638
+ },
639
+ {
640
+ "inside": {
641
+ "kind": "parenthesized_expression",
642
+ "matches": "chain-up-pattern"
643
+ }
644
+ }
645
+ ]
646
+ },
647
+ "rhs-slot": {
648
+ "any": [
649
+ {
650
+ "matches": "rhs-root"
651
+ },
652
+ {
653
+ "inside": {
654
+ "kind": "parenthesized_expression",
655
+ "matches": "rhs-slot"
656
+ }
657
+ }
658
+ ]
659
+ },
660
+ "props-id-setup": {
661
+ "kind": "identifier",
662
+ "inside": {
663
+ "stopBy": {
664
+ "matches": "barrier"
665
+ },
666
+ "matches": "setup-fn"
667
+ },
668
+ "resolves": {
669
+ "binding": {
670
+ "occurrence": {
671
+ "kind": "identifier",
672
+ "matches": "setup-param-slot"
673
+ }
674
+ }
675
+ }
676
+ },
677
+ "props-member-ref-setup": {
678
+ "all": [
679
+ {
680
+ "matches": "props-id-setup"
681
+ },
682
+ {
683
+ "inside": {
684
+ "any": [
685
+ {
686
+ "kind": "member_expression"
687
+ },
688
+ {
689
+ "kind": "subscript_expression"
690
+ }
691
+ ],
692
+ "field": "object"
693
+ }
694
+ }
695
+ ]
696
+ },
697
+ "props-id-script": {
698
+ "kind": "identifier",
699
+ "inside": {
700
+ "stopBy": {
701
+ "matches": "barrier"
702
+ },
703
+ "kind": "program"
704
+ },
705
+ "resolves": {
706
+ "binding": {
707
+ "occurrence": {
708
+ "kind": "identifier",
709
+ "any": [
710
+ {
711
+ "inside": {
712
+ "field": "name",
713
+ "matches": "setup-decl"
714
+ }
715
+ },
716
+ {
717
+ "inside": {
718
+ "kind": "rest_pattern",
719
+ "inside": {
720
+ "matches": "setup-object-pattern"
721
+ }
722
+ }
723
+ }
724
+ ]
725
+ }
726
+ }
727
+ }
728
+ },
729
+ "prop-ref-script": {
730
+ "all": [
731
+ {
732
+ "any": [
733
+ {
734
+ "kind": "identifier"
735
+ },
736
+ {
737
+ "kind": "shorthand_property_identifier"
738
+ }
739
+ ]
740
+ },
741
+ {
742
+ "not": {
743
+ "matches": "write-position"
744
+ }
745
+ },
746
+ {
747
+ "inside": {
748
+ "stopBy": {
749
+ "matches": "barrier"
750
+ },
751
+ "kind": "program"
752
+ }
753
+ },
754
+ {
755
+ "resolves": {
756
+ "binding": {
757
+ "occurrence": {
758
+ "any": [
759
+ {
760
+ "kind": "shorthand_property_identifier_pattern",
761
+ "inside": {
762
+ "matches": "setup-object-pattern"
763
+ }
764
+ },
765
+ {
766
+ "kind": "shorthand_property_identifier_pattern",
767
+ "inside": {
768
+ "kind": "object_assignment_pattern",
769
+ "field": "left",
770
+ "inside": {
771
+ "matches": "setup-object-pattern"
772
+ }
773
+ }
774
+ },
775
+ {
776
+ "kind": "identifier",
777
+ "inside": {
778
+ "kind": "pair_pattern",
779
+ "field": "value",
780
+ "inside": {
781
+ "matches": "setup-object-pattern"
782
+ }
783
+ }
784
+ },
785
+ {
786
+ "kind": "identifier",
787
+ "inside": {
788
+ "kind": "assignment_pattern",
789
+ "field": "left",
790
+ "inside": {
791
+ "kind": "pair_pattern",
792
+ "field": "value",
793
+ "inside": {
794
+ "matches": "setup-object-pattern"
795
+ }
796
+ }
797
+ }
798
+ }
799
+ ]
800
+ }
801
+ }
802
+ }
803
+ }
804
+ ]
805
+ },
806
+ "props-member-ref-script": {
807
+ "any": [
808
+ {
809
+ "all": [
810
+ {
811
+ "matches": "props-id-script"
812
+ },
813
+ {
814
+ "inside": {
815
+ "any": [
816
+ {
817
+ "kind": "member_expression"
818
+ },
819
+ {
820
+ "kind": "subscript_expression"
821
+ }
822
+ ],
823
+ "field": "object"
824
+ }
825
+ }
826
+ ]
827
+ },
828
+ {
829
+ "matches": "prop-ref-script"
830
+ }
831
+ ]
832
+ },
833
+ "contains-ref-setup": {
834
+ "any": [
835
+ {
836
+ "matches": "props-member-ref-setup"
837
+ },
838
+ {
839
+ "has": {
840
+ "stopBy": "end",
841
+ "matches": "props-member-ref-setup"
842
+ }
843
+ }
844
+ ]
845
+ },
846
+ "chain-has-props-setup": {
847
+ "any": [
848
+ {
849
+ "kind": "identifier",
850
+ "matches": "props-id-setup"
851
+ },
852
+ {
853
+ "any": [
854
+ {
855
+ "kind": "member_expression"
856
+ },
857
+ {
858
+ "kind": "subscript_expression"
859
+ }
860
+ ],
861
+ "has": {
862
+ "field": "object",
863
+ "matches": "chain-has-props-setup"
864
+ }
865
+ },
866
+ {
867
+ "kind": "parenthesized_expression",
868
+ "has": {
869
+ "matches": "chain-has-props-setup"
870
+ }
871
+ },
872
+ {
873
+ "kind": "template_string",
874
+ "has": {
875
+ "kind": "template_substitution",
876
+ "has": {
877
+ "kind": "identifier",
878
+ "matches": "props-id-setup"
879
+ }
880
+ }
881
+ },
882
+ {
883
+ "kind": "ternary_expression",
884
+ "has": {
885
+ "kind": "identifier",
886
+ "matches": "props-id-setup"
887
+ }
888
+ }
889
+ ]
890
+ },
891
+ "contains-ref-script": {
892
+ "any": [
893
+ {
894
+ "matches": "props-member-ref-script"
895
+ },
896
+ {
897
+ "has": {
898
+ "stopBy": "end",
899
+ "matches": "props-member-ref-script"
900
+ }
901
+ }
902
+ ]
903
+ },
904
+ "chain-has-props-script": {
905
+ "any": [
906
+ {
907
+ "kind": "identifier",
908
+ "matches": "props-id-script"
909
+ },
910
+ {
911
+ "any": [
912
+ {
913
+ "kind": "member_expression"
914
+ },
915
+ {
916
+ "kind": "subscript_expression"
917
+ }
918
+ ],
919
+ "has": {
920
+ "field": "object",
921
+ "matches": "chain-has-props-script"
922
+ }
923
+ },
924
+ {
925
+ "kind": "parenthesized_expression",
926
+ "has": {
927
+ "matches": "chain-has-props-script"
928
+ }
929
+ },
930
+ {
931
+ "kind": "template_string",
932
+ "has": {
933
+ "kind": "template_substitution",
934
+ "has": {
935
+ "kind": "identifier",
936
+ "matches": "props-id-script"
937
+ }
938
+ }
939
+ },
940
+ {
941
+ "kind": "ternary_expression",
942
+ "has": {
943
+ "kind": "identifier",
944
+ "matches": "props-id-script"
945
+ }
946
+ }
947
+ ]
948
+ },
949
+ "ternary-condition-slot-setup": {
950
+ "any": [
951
+ {
952
+ "inside": {
953
+ "kind": "ternary_expression",
954
+ "field": "condition",
955
+ "all": [
956
+ {
957
+ "all": [
958
+ {
959
+ "matches": "chain-up"
960
+ },
961
+ {
962
+ "not": {
963
+ "all": [
964
+ {
965
+ "matches": "chain-up-pattern"
966
+ },
967
+ {
968
+ "has": {
969
+ "kind": "identifier",
970
+ "matches": "props-id-setup"
971
+ }
972
+ }
973
+ ]
974
+ }
975
+ }
976
+ ]
977
+ }
978
+ ]
979
+ }
980
+ },
981
+ {
982
+ "inside": {
983
+ "kind": "parenthesized_expression",
984
+ "matches": "ternary-condition-slot-setup"
985
+ }
986
+ }
987
+ ]
988
+ },
989
+ "ternary-consequence-slot-setup": {
990
+ "any": [
991
+ {
992
+ "inside": {
993
+ "kind": "ternary_expression",
994
+ "field": "consequence",
995
+ "all": [
996
+ {
997
+ "all": [
998
+ {
999
+ "matches": "chain-up"
1000
+ },
1001
+ {
1002
+ "not": {
1003
+ "all": [
1004
+ {
1005
+ "matches": "chain-up-pattern"
1006
+ },
1007
+ {
1008
+ "has": {
1009
+ "kind": "identifier",
1010
+ "matches": "props-id-setup"
1011
+ }
1012
+ }
1013
+ ]
1014
+ }
1015
+ }
1016
+ ]
1017
+ },
1018
+ {
1019
+ "not": {
1020
+ "has": {
1021
+ "field": "condition",
1022
+ "matches": "contains-ref-setup"
1023
+ }
1024
+ }
1025
+ }
1026
+ ]
1027
+ }
1028
+ },
1029
+ {
1030
+ "inside": {
1031
+ "kind": "parenthesized_expression",
1032
+ "matches": "ternary-consequence-slot-setup"
1033
+ }
1034
+ }
1035
+ ]
1036
+ },
1037
+ "ternary-alternative-slot-setup": {
1038
+ "any": [
1039
+ {
1040
+ "inside": {
1041
+ "kind": "ternary_expression",
1042
+ "field": "alternative",
1043
+ "all": [
1044
+ {
1045
+ "all": [
1046
+ {
1047
+ "matches": "chain-up"
1048
+ },
1049
+ {
1050
+ "not": {
1051
+ "all": [
1052
+ {
1053
+ "matches": "chain-up-pattern"
1054
+ },
1055
+ {
1056
+ "has": {
1057
+ "kind": "identifier",
1058
+ "matches": "props-id-setup"
1059
+ }
1060
+ }
1061
+ ]
1062
+ }
1063
+ }
1064
+ ]
1065
+ },
1066
+ {
1067
+ "not": {
1068
+ "has": {
1069
+ "field": "condition",
1070
+ "matches": "contains-ref-setup"
1071
+ }
1072
+ }
1073
+ },
1074
+ {
1075
+ "not": {
1076
+ "has": {
1077
+ "field": "consequence",
1078
+ "matches": "contains-ref-setup"
1079
+ }
1080
+ }
1081
+ }
1082
+ ]
1083
+ }
1084
+ },
1085
+ {
1086
+ "inside": {
1087
+ "kind": "parenthesized_expression",
1088
+ "matches": "ternary-alternative-slot-setup"
1089
+ }
1090
+ }
1091
+ ]
1092
+ },
1093
+ "ternary-condition-slot-script": {
1094
+ "any": [
1095
+ {
1096
+ "inside": {
1097
+ "kind": "ternary_expression",
1098
+ "field": "condition",
1099
+ "all": [
1100
+ {
1101
+ "all": [
1102
+ {
1103
+ "matches": "chain-up"
1104
+ },
1105
+ {
1106
+ "not": {
1107
+ "all": [
1108
+ {
1109
+ "matches": "chain-up-pattern"
1110
+ },
1111
+ {
1112
+ "has": {
1113
+ "kind": "identifier",
1114
+ "matches": "props-id-script"
1115
+ }
1116
+ }
1117
+ ]
1118
+ }
1119
+ }
1120
+ ]
1121
+ }
1122
+ ]
1123
+ }
1124
+ },
1125
+ {
1126
+ "inside": {
1127
+ "kind": "parenthesized_expression",
1128
+ "matches": "ternary-condition-slot-script"
1129
+ }
1130
+ }
1131
+ ]
1132
+ },
1133
+ "ternary-consequence-slot-script": {
1134
+ "any": [
1135
+ {
1136
+ "inside": {
1137
+ "kind": "ternary_expression",
1138
+ "field": "consequence",
1139
+ "all": [
1140
+ {
1141
+ "all": [
1142
+ {
1143
+ "matches": "chain-up"
1144
+ },
1145
+ {
1146
+ "not": {
1147
+ "all": [
1148
+ {
1149
+ "matches": "chain-up-pattern"
1150
+ },
1151
+ {
1152
+ "has": {
1153
+ "kind": "identifier",
1154
+ "matches": "props-id-script"
1155
+ }
1156
+ }
1157
+ ]
1158
+ }
1159
+ }
1160
+ ]
1161
+ },
1162
+ {
1163
+ "not": {
1164
+ "has": {
1165
+ "field": "condition",
1166
+ "matches": "contains-ref-script"
1167
+ }
1168
+ }
1169
+ }
1170
+ ]
1171
+ }
1172
+ },
1173
+ {
1174
+ "inside": {
1175
+ "kind": "parenthesized_expression",
1176
+ "matches": "ternary-consequence-slot-script"
1177
+ }
1178
+ }
1179
+ ]
1180
+ },
1181
+ "ternary-alternative-slot-script": {
1182
+ "any": [
1183
+ {
1184
+ "inside": {
1185
+ "kind": "ternary_expression",
1186
+ "field": "alternative",
1187
+ "all": [
1188
+ {
1189
+ "all": [
1190
+ {
1191
+ "matches": "chain-up"
1192
+ },
1193
+ {
1194
+ "not": {
1195
+ "all": [
1196
+ {
1197
+ "matches": "chain-up-pattern"
1198
+ },
1199
+ {
1200
+ "has": {
1201
+ "kind": "identifier",
1202
+ "matches": "props-id-script"
1203
+ }
1204
+ }
1205
+ ]
1206
+ }
1207
+ }
1208
+ ]
1209
+ },
1210
+ {
1211
+ "not": {
1212
+ "has": {
1213
+ "field": "condition",
1214
+ "matches": "contains-ref-script"
1215
+ }
1216
+ }
1217
+ },
1218
+ {
1219
+ "not": {
1220
+ "has": {
1221
+ "field": "consequence",
1222
+ "matches": "contains-ref-script"
1223
+ }
1224
+ }
1225
+ }
1226
+ ]
1227
+ }
1228
+ },
1229
+ {
1230
+ "inside": {
1231
+ "kind": "parenthesized_expression",
1232
+ "matches": "ternary-alternative-slot-script"
1233
+ }
1234
+ }
1235
+ ]
1236
+ }
1237
+ }
1238
+ }
1239
+ },
1240
+ {
1241
+ "id": "destructuring",
1242
+ "forbid": {
1243
+ "ast": {
1244
+ "language": "vue",
1245
+ "embedded": "script-block",
1246
+ "rule": {
1247
+ "any": [
1248
+ {
1249
+ "all": [
1250
+ {
1251
+ "any": [
1252
+ {
1253
+ "kind": "object_pattern"
1254
+ },
1255
+ {
1256
+ "kind": "array_pattern"
1257
+ }
1258
+ ]
1259
+ },
1260
+ {
1261
+ "matches": "setup-param-slot"
1262
+ }
1263
+ ]
1264
+ },
1265
+ {
1266
+ "kind": "array_pattern",
1267
+ "inside": {
1268
+ "field": "name",
1269
+ "matches": "setup-decl"
1270
+ }
1271
+ },
1272
+ {
1273
+ "all": [
1274
+ {
1275
+ "any": [
1276
+ {
1277
+ "kind": "object_pattern"
1278
+ },
1279
+ {
1280
+ "kind": "array_pattern"
1281
+ }
1282
+ ]
1283
+ },
1284
+ {
1285
+ "any": [
1286
+ {
1287
+ "inside": {
1288
+ "kind": "pair_pattern",
1289
+ "field": "value",
1290
+ "inside": {
1291
+ "matches": "setup-object-pattern"
1292
+ }
1293
+ }
1294
+ },
1295
+ {
1296
+ "inside": {
1297
+ "kind": "assignment_pattern",
1298
+ "field": "left",
1299
+ "inside": {
1300
+ "kind": "pair_pattern",
1301
+ "field": "value",
1302
+ "inside": {
1303
+ "matches": "setup-object-pattern"
1304
+ }
1305
+ }
1306
+ }
1307
+ }
1308
+ ]
1309
+ }
1310
+ ]
1311
+ }
1312
+ ]
1313
+ }
1314
+ }
1315
+ },
1316
+ "violation": {
1317
+ "anchor": "witness.span",
1318
+ "code": "vue/no-setup-props-reactivity-loss",
1319
+ "message": "Keep `props` whole and read its fields where used, or destructure with toRefs, so the values stay reactive.",
1320
+ "suppress": {
1321
+ "eslint": {
1322
+ "rules": [
1323
+ "vue/no-setup-props-reactivity-loss"
1324
+ ]
1325
+ }
1326
+ }
1327
+ }
1328
+ },
1329
+ {
1330
+ "id": "get-property-setup-0",
1331
+ "forbid": {
1332
+ "ast": {
1333
+ "language": "vue",
1334
+ "embedded": "script-block",
1335
+ "rule": {
1336
+ "kind": "call_expression",
1337
+ "all": [
1338
+ {
1339
+ "not": {
1340
+ "has": {
1341
+ "field": "arguments",
1342
+ "kind": "template_string"
1343
+ }
1344
+ }
1345
+ },
1346
+ {
1347
+ "inside": {
1348
+ "stopBy": {
1349
+ "matches": "barrier"
1350
+ },
1351
+ "matches": "setup-fn"
1352
+ }
1353
+ },
1354
+ {
1355
+ "has": {
1356
+ "stopBy": "end",
1357
+ "matches": "props-member-ref-setup"
1358
+ }
1359
+ }
1360
+ ]
1361
+ }
1362
+ }
1363
+ },
1364
+ "violation": {
1365
+ "anchor": "witness.span",
1366
+ "code": "vue/no-setup-props-reactivity-loss",
1367
+ "message": "Read this from `props` inside a computed, watcher or function in setup(), or use toRefs, so it stays reactive.",
1368
+ "suppress": {
1369
+ "eslint": {
1370
+ "rules": [
1371
+ "vue/no-setup-props-reactivity-loss"
1372
+ ]
1373
+ }
1374
+ }
1375
+ }
1376
+ },
1377
+ {
1378
+ "id": "get-property-setup-1",
1379
+ "forbid": {
1380
+ "ast": {
1381
+ "language": "vue",
1382
+ "embedded": "script-block",
1383
+ "rule": {
1384
+ "all": [
1385
+ {
1386
+ "any": [
1387
+ {
1388
+ "kind": "array"
1389
+ },
1390
+ {
1391
+ "kind": "object"
1392
+ }
1393
+ ]
1394
+ },
1395
+ {
1396
+ "matches": "rhs-slot"
1397
+ },
1398
+ {
1399
+ "has": {
1400
+ "stopBy": "end",
1401
+ "matches": "props-member-ref-setup"
1402
+ }
1403
+ }
1404
+ ]
1405
+ }
1406
+ }
1407
+ },
1408
+ "violation": {
1409
+ "anchor": "witness.span",
1410
+ "code": "vue/no-setup-props-reactivity-loss",
1411
+ "message": "Read this from `props` inside a computed, watcher or function in setup(), or use toRefs, so it stays reactive.",
1412
+ "suppress": {
1413
+ "eslint": {
1414
+ "rules": [
1415
+ "vue/no-setup-props-reactivity-loss"
1416
+ ]
1417
+ }
1418
+ }
1419
+ }
1420
+ },
1421
+ {
1422
+ "id": "get-property-setup-2",
1423
+ "forbid": {
1424
+ "ast": {
1425
+ "language": "vue",
1426
+ "embedded": "script-block",
1427
+ "rule": {
1428
+ "all": [
1429
+ {
1430
+ "kind": "identifier"
1431
+ },
1432
+ {
1433
+ "matches": "props-member-ref-setup"
1434
+ },
1435
+ {
1436
+ "matches": "chain-up"
1437
+ },
1438
+ {
1439
+ "not": {
1440
+ "all": [
1441
+ {
1442
+ "matches": "chain-up-pattern"
1443
+ },
1444
+ {
1445
+ "matches": "props-id-setup"
1446
+ }
1447
+ ]
1448
+ }
1449
+ }
1450
+ ]
1451
+ }
1452
+ }
1453
+ },
1454
+ "violation": {
1455
+ "anchor": "witness.span",
1456
+ "code": "vue/no-setup-props-reactivity-loss",
1457
+ "message": "Read this from `props` inside a computed, watcher or function in setup(), or use toRefs, so it stays reactive.",
1458
+ "suppress": {
1459
+ "eslint": {
1460
+ "rules": [
1461
+ "vue/no-setup-props-reactivity-loss"
1462
+ ]
1463
+ }
1464
+ }
1465
+ }
1466
+ },
1467
+ {
1468
+ "id": "get-property-setup-3",
1469
+ "forbid": {
1470
+ "ast": {
1471
+ "language": "vue",
1472
+ "embedded": "script-block",
1473
+ "rule": {
1474
+ "all": [
1475
+ {
1476
+ "not": {
1477
+ "kind": "parenthesized_expression"
1478
+ }
1479
+ },
1480
+ {
1481
+ "matches": "contains-ref-setup"
1482
+ },
1483
+ {
1484
+ "inside": {
1485
+ "kind": "template_substitution",
1486
+ "all": [
1487
+ {
1488
+ "inside": {
1489
+ "kind": "template_string",
1490
+ "all": [
1491
+ {
1492
+ "matches": "chain-up"
1493
+ },
1494
+ {
1495
+ "not": {
1496
+ "all": [
1497
+ {
1498
+ "matches": "chain-up-pattern"
1499
+ },
1500
+ {
1501
+ "has": {
1502
+ "kind": "template_substitution",
1503
+ "has": {
1504
+ "kind": "identifier",
1505
+ "matches": "props-id-setup"
1506
+ }
1507
+ }
1508
+ }
1509
+ ]
1510
+ }
1511
+ }
1512
+ ]
1513
+ }
1514
+ },
1515
+ {
1516
+ "not": {
1517
+ "follows": {
1518
+ "stopBy": "end",
1519
+ "kind": "template_substitution",
1520
+ "has": {
1521
+ "matches": "contains-ref-setup"
1522
+ }
1523
+ }
1524
+ }
1525
+ }
1526
+ ]
1527
+ }
1528
+ }
1529
+ ]
1530
+ }
1531
+ }
1532
+ },
1533
+ "violation": {
1534
+ "anchor": "witness.span",
1535
+ "code": "vue/no-setup-props-reactivity-loss",
1536
+ "message": "Read this from `props` inside a computed, watcher or function in setup(), or use toRefs, so it stays reactive.",
1537
+ "suppress": {
1538
+ "eslint": {
1539
+ "rules": [
1540
+ "vue/no-setup-props-reactivity-loss"
1541
+ ]
1542
+ }
1543
+ }
1544
+ }
1545
+ },
1546
+ {
1547
+ "id": "get-property-setup-4",
1548
+ "forbid": {
1549
+ "ast": {
1550
+ "language": "vue",
1551
+ "embedded": "script-block",
1552
+ "rule": {
1553
+ "all": [
1554
+ {
1555
+ "not": {
1556
+ "kind": "parenthesized_expression"
1557
+ }
1558
+ },
1559
+ {
1560
+ "matches": "contains-ref-setup"
1561
+ },
1562
+ {
1563
+ "matches": "ternary-condition-slot-setup"
1564
+ }
1565
+ ]
1566
+ }
1567
+ }
1568
+ },
1569
+ "violation": {
1570
+ "anchor": "witness.span",
1571
+ "code": "vue/no-setup-props-reactivity-loss",
1572
+ "message": "Read this from `props` inside a computed, watcher or function in setup(), or use toRefs, so it stays reactive.",
1573
+ "suppress": {
1574
+ "eslint": {
1575
+ "rules": [
1576
+ "vue/no-setup-props-reactivity-loss"
1577
+ ]
1578
+ }
1579
+ }
1580
+ }
1581
+ },
1582
+ {
1583
+ "id": "get-property-setup-5",
1584
+ "forbid": {
1585
+ "ast": {
1586
+ "language": "vue",
1587
+ "embedded": "script-block",
1588
+ "rule": {
1589
+ "all": [
1590
+ {
1591
+ "not": {
1592
+ "kind": "parenthesized_expression"
1593
+ }
1594
+ },
1595
+ {
1596
+ "matches": "contains-ref-setup"
1597
+ },
1598
+ {
1599
+ "matches": "ternary-consequence-slot-setup"
1600
+ }
1601
+ ]
1602
+ }
1603
+ }
1604
+ },
1605
+ "violation": {
1606
+ "anchor": "witness.span",
1607
+ "code": "vue/no-setup-props-reactivity-loss",
1608
+ "message": "Read this from `props` inside a computed, watcher or function in setup(), or use toRefs, so it stays reactive.",
1609
+ "suppress": {
1610
+ "eslint": {
1611
+ "rules": [
1612
+ "vue/no-setup-props-reactivity-loss"
1613
+ ]
1614
+ }
1615
+ }
1616
+ }
1617
+ },
1618
+ {
1619
+ "id": "get-property-setup-6",
1620
+ "forbid": {
1621
+ "ast": {
1622
+ "language": "vue",
1623
+ "embedded": "script-block",
1624
+ "rule": {
1625
+ "all": [
1626
+ {
1627
+ "not": {
1628
+ "kind": "parenthesized_expression"
1629
+ }
1630
+ },
1631
+ {
1632
+ "matches": "contains-ref-setup"
1633
+ },
1634
+ {
1635
+ "matches": "ternary-alternative-slot-setup"
1636
+ }
1637
+ ]
1638
+ }
1639
+ }
1640
+ },
1641
+ "violation": {
1642
+ "anchor": "witness.span",
1643
+ "code": "vue/no-setup-props-reactivity-loss",
1644
+ "message": "Read this from `props` inside a computed, watcher or function in setup(), or use toRefs, so it stays reactive.",
1645
+ "suppress": {
1646
+ "eslint": {
1647
+ "rules": [
1648
+ "vue/no-setup-props-reactivity-loss"
1649
+ ]
1650
+ }
1651
+ }
1652
+ }
1653
+ },
1654
+ {
1655
+ "id": "get-property-setup-7",
1656
+ "forbid": {
1657
+ "ast": {
1658
+ "language": "vue",
1659
+ "embedded": "script-block",
1660
+ "rule": {
1661
+ "all": [
1662
+ {
1663
+ "any": [
1664
+ {
1665
+ "kind": "object_pattern"
1666
+ },
1667
+ {
1668
+ "kind": "array_pattern"
1669
+ }
1670
+ ]
1671
+ },
1672
+ {
1673
+ "any": [
1674
+ {
1675
+ "inside": {
1676
+ "kind": "variable_declarator",
1677
+ "field": "name",
1678
+ "has": {
1679
+ "field": "value",
1680
+ "matches": "chain-has-props-setup"
1681
+ }
1682
+ }
1683
+ },
1684
+ {
1685
+ "inside": {
1686
+ "kind": "assignment_expression",
1687
+ "field": "left",
1688
+ "has": {
1689
+ "field": "right",
1690
+ "matches": "chain-has-props-setup"
1691
+ }
1692
+ }
1693
+ }
1694
+ ]
1695
+ }
1696
+ ]
1697
+ }
1698
+ }
1699
+ },
1700
+ "violation": {
1701
+ "anchor": "witness.span",
1702
+ "code": "vue/no-setup-props-reactivity-loss",
1703
+ "message": "Read this from `props` inside a computed, watcher or function in setup(), or use toRefs, so it stays reactive.",
1704
+ "suppress": {
1705
+ "eslint": {
1706
+ "rules": [
1707
+ "vue/no-setup-props-reactivity-loss"
1708
+ ]
1709
+ }
1710
+ }
1711
+ }
1712
+ },
1713
+ {
1714
+ "id": "get-property-script-0",
1715
+ "forbid": {
1716
+ "ast": {
1717
+ "language": "vue",
1718
+ "embedded": "script-block",
1719
+ "rule": {
1720
+ "kind": "call_expression",
1721
+ "all": [
1722
+ {
1723
+ "not": {
1724
+ "has": {
1725
+ "field": "arguments",
1726
+ "kind": "template_string"
1727
+ }
1728
+ }
1729
+ },
1730
+ {
1731
+ "inside": {
1732
+ "stopBy": {
1733
+ "matches": "barrier"
1734
+ },
1735
+ "kind": "program"
1736
+ }
1737
+ },
1738
+ {
1739
+ "has": {
1740
+ "stopBy": "end",
1741
+ "matches": "props-member-ref-script"
1742
+ }
1743
+ }
1744
+ ]
1745
+ }
1746
+ }
1747
+ },
1748
+ "violation": {
1749
+ "anchor": "witness.span",
1750
+ "code": "vue/no-setup-props-reactivity-loss",
1751
+ "message": "Read this from `props` inside a computed, watcher or function, or use toRefs, so it stays reactive.",
1752
+ "suppress": {
1753
+ "eslint": {
1754
+ "rules": [
1755
+ "vue/no-setup-props-reactivity-loss"
1756
+ ]
1757
+ }
1758
+ }
1759
+ }
1760
+ },
1761
+ {
1762
+ "id": "get-property-script-1",
1763
+ "forbid": {
1764
+ "ast": {
1765
+ "language": "vue",
1766
+ "embedded": "script-block",
1767
+ "rule": {
1768
+ "all": [
1769
+ {
1770
+ "any": [
1771
+ {
1772
+ "kind": "array"
1773
+ },
1774
+ {
1775
+ "kind": "object"
1776
+ }
1777
+ ]
1778
+ },
1779
+ {
1780
+ "matches": "rhs-slot"
1781
+ },
1782
+ {
1783
+ "has": {
1784
+ "stopBy": "end",
1785
+ "matches": "props-member-ref-script"
1786
+ }
1787
+ }
1788
+ ]
1789
+ }
1790
+ }
1791
+ },
1792
+ "violation": {
1793
+ "anchor": "witness.span",
1794
+ "code": "vue/no-setup-props-reactivity-loss",
1795
+ "message": "Read this from `props` inside a computed, watcher or function, or use toRefs, so it stays reactive.",
1796
+ "suppress": {
1797
+ "eslint": {
1798
+ "rules": [
1799
+ "vue/no-setup-props-reactivity-loss"
1800
+ ]
1801
+ }
1802
+ }
1803
+ }
1804
+ },
1805
+ {
1806
+ "id": "get-property-script-2",
1807
+ "forbid": {
1808
+ "ast": {
1809
+ "language": "vue",
1810
+ "embedded": "script-block",
1811
+ "rule": {
1812
+ "all": [
1813
+ {
1814
+ "kind": "identifier"
1815
+ },
1816
+ {
1817
+ "matches": "props-member-ref-script"
1818
+ },
1819
+ {
1820
+ "matches": "chain-up"
1821
+ },
1822
+ {
1823
+ "not": {
1824
+ "all": [
1825
+ {
1826
+ "matches": "chain-up-pattern"
1827
+ },
1828
+ {
1829
+ "matches": "props-id-script"
1830
+ }
1831
+ ]
1832
+ }
1833
+ }
1834
+ ]
1835
+ }
1836
+ }
1837
+ },
1838
+ "violation": {
1839
+ "anchor": "witness.span",
1840
+ "code": "vue/no-setup-props-reactivity-loss",
1841
+ "message": "Read this from `props` inside a computed, watcher or function, or use toRefs, so it stays reactive.",
1842
+ "suppress": {
1843
+ "eslint": {
1844
+ "rules": [
1845
+ "vue/no-setup-props-reactivity-loss"
1846
+ ]
1847
+ }
1848
+ }
1849
+ }
1850
+ },
1851
+ {
1852
+ "id": "get-property-script-3",
1853
+ "forbid": {
1854
+ "ast": {
1855
+ "language": "vue",
1856
+ "embedded": "script-block",
1857
+ "rule": {
1858
+ "all": [
1859
+ {
1860
+ "not": {
1861
+ "kind": "parenthesized_expression"
1862
+ }
1863
+ },
1864
+ {
1865
+ "matches": "contains-ref-script"
1866
+ },
1867
+ {
1868
+ "inside": {
1869
+ "kind": "template_substitution",
1870
+ "all": [
1871
+ {
1872
+ "inside": {
1873
+ "kind": "template_string",
1874
+ "all": [
1875
+ {
1876
+ "matches": "chain-up"
1877
+ },
1878
+ {
1879
+ "not": {
1880
+ "all": [
1881
+ {
1882
+ "matches": "chain-up-pattern"
1883
+ },
1884
+ {
1885
+ "has": {
1886
+ "kind": "template_substitution",
1887
+ "has": {
1888
+ "kind": "identifier",
1889
+ "matches": "props-id-script"
1890
+ }
1891
+ }
1892
+ }
1893
+ ]
1894
+ }
1895
+ }
1896
+ ]
1897
+ }
1898
+ },
1899
+ {
1900
+ "not": {
1901
+ "follows": {
1902
+ "stopBy": "end",
1903
+ "kind": "template_substitution",
1904
+ "has": {
1905
+ "matches": "contains-ref-script"
1906
+ }
1907
+ }
1908
+ }
1909
+ }
1910
+ ]
1911
+ }
1912
+ }
1913
+ ]
1914
+ }
1915
+ }
1916
+ },
1917
+ "violation": {
1918
+ "anchor": "witness.span",
1919
+ "code": "vue/no-setup-props-reactivity-loss",
1920
+ "message": "Read this from `props` inside a computed, watcher or function, or use toRefs, so it stays reactive.",
1921
+ "suppress": {
1922
+ "eslint": {
1923
+ "rules": [
1924
+ "vue/no-setup-props-reactivity-loss"
1925
+ ]
1926
+ }
1927
+ }
1928
+ }
1929
+ },
1930
+ {
1931
+ "id": "get-property-script-4",
1932
+ "forbid": {
1933
+ "ast": {
1934
+ "language": "vue",
1935
+ "embedded": "script-block",
1936
+ "rule": {
1937
+ "all": [
1938
+ {
1939
+ "not": {
1940
+ "kind": "parenthesized_expression"
1941
+ }
1942
+ },
1943
+ {
1944
+ "matches": "contains-ref-script"
1945
+ },
1946
+ {
1947
+ "matches": "ternary-condition-slot-script"
1948
+ }
1949
+ ]
1950
+ }
1951
+ }
1952
+ },
1953
+ "violation": {
1954
+ "anchor": "witness.span",
1955
+ "code": "vue/no-setup-props-reactivity-loss",
1956
+ "message": "Read this from `props` inside a computed, watcher or function, or use toRefs, so it stays reactive.",
1957
+ "suppress": {
1958
+ "eslint": {
1959
+ "rules": [
1960
+ "vue/no-setup-props-reactivity-loss"
1961
+ ]
1962
+ }
1963
+ }
1964
+ }
1965
+ },
1966
+ {
1967
+ "id": "get-property-script-5",
1968
+ "forbid": {
1969
+ "ast": {
1970
+ "language": "vue",
1971
+ "embedded": "script-block",
1972
+ "rule": {
1973
+ "all": [
1974
+ {
1975
+ "not": {
1976
+ "kind": "parenthesized_expression"
1977
+ }
1978
+ },
1979
+ {
1980
+ "matches": "contains-ref-script"
1981
+ },
1982
+ {
1983
+ "matches": "ternary-consequence-slot-script"
1984
+ }
1985
+ ]
1986
+ }
1987
+ }
1988
+ },
1989
+ "violation": {
1990
+ "anchor": "witness.span",
1991
+ "code": "vue/no-setup-props-reactivity-loss",
1992
+ "message": "Read this from `props` inside a computed, watcher or function, or use toRefs, so it stays reactive.",
1993
+ "suppress": {
1994
+ "eslint": {
1995
+ "rules": [
1996
+ "vue/no-setup-props-reactivity-loss"
1997
+ ]
1998
+ }
1999
+ }
2000
+ }
2001
+ },
2002
+ {
2003
+ "id": "get-property-script-6",
2004
+ "forbid": {
2005
+ "ast": {
2006
+ "language": "vue",
2007
+ "embedded": "script-block",
2008
+ "rule": {
2009
+ "all": [
2010
+ {
2011
+ "not": {
2012
+ "kind": "parenthesized_expression"
2013
+ }
2014
+ },
2015
+ {
2016
+ "matches": "contains-ref-script"
2017
+ },
2018
+ {
2019
+ "matches": "ternary-alternative-slot-script"
2020
+ }
2021
+ ]
2022
+ }
2023
+ }
2024
+ },
2025
+ "violation": {
2026
+ "anchor": "witness.span",
2027
+ "code": "vue/no-setup-props-reactivity-loss",
2028
+ "message": "Read this from `props` inside a computed, watcher or function, or use toRefs, so it stays reactive.",
2029
+ "suppress": {
2030
+ "eslint": {
2031
+ "rules": [
2032
+ "vue/no-setup-props-reactivity-loss"
2033
+ ]
2034
+ }
2035
+ }
2036
+ }
2037
+ },
2038
+ {
2039
+ "id": "get-property-script-7",
2040
+ "forbid": {
2041
+ "ast": {
2042
+ "language": "vue",
2043
+ "embedded": "script-block",
2044
+ "rule": {
2045
+ "all": [
2046
+ {
2047
+ "any": [
2048
+ {
2049
+ "kind": "object_pattern"
2050
+ },
2051
+ {
2052
+ "kind": "array_pattern"
2053
+ }
2054
+ ]
2055
+ },
2056
+ {
2057
+ "any": [
2058
+ {
2059
+ "inside": {
2060
+ "kind": "variable_declarator",
2061
+ "field": "name",
2062
+ "has": {
2063
+ "field": "value",
2064
+ "matches": "chain-has-props-script"
2065
+ }
2066
+ }
2067
+ },
2068
+ {
2069
+ "inside": {
2070
+ "kind": "assignment_expression",
2071
+ "field": "left",
2072
+ "has": {
2073
+ "field": "right",
2074
+ "matches": "chain-has-props-script"
2075
+ }
2076
+ }
2077
+ }
2078
+ ]
2079
+ }
2080
+ ]
2081
+ }
2082
+ }
2083
+ },
2084
+ "violation": {
2085
+ "anchor": "witness.span",
2086
+ "code": "vue/no-setup-props-reactivity-loss",
2087
+ "message": "Read this from `props` inside a computed, watcher or function, or use toRefs, so it stays reactive.",
2088
+ "suppress": {
2089
+ "eslint": {
2090
+ "rules": [
2091
+ "vue/no-setup-props-reactivity-loss"
2092
+ ]
2093
+ }
2094
+ }
2095
+ }
2096
+ }
2097
+ ]
2098
+ }