@neralabs/rerail-pack-vue 0.1.3 → 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,1164 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "eslint-plugin-vue-no-ref-as-operand",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Use .value when reading or writing a Vue ref or computed in script code; using the ref object itself as an operand acts on the wrapper, not its value.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*.vue"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "shared",
16
+ "define": {
17
+ "language": "vue",
18
+ "utils": {
19
+ "in-script-setup": {
20
+ "inside": {
21
+ "stopBy": "end",
22
+ "follows": {
23
+ "stopBy": {
24
+ "kind": "empty_statement",
25
+ "host": {
26
+ "kind": "start_tag",
27
+ "regex": "^<script\\b"
28
+ }
29
+ },
30
+ "kind": "empty_statement",
31
+ "host": {
32
+ "kind": "start_tag",
33
+ "regex": "^<script(?:\\s+[^\\s\"'<>/=]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s\"'<>=`]+))?)*\\s+setup(?:[\\s/>=]|$)"
34
+ }
35
+ }
36
+ }
37
+ },
38
+ "component-callee": {
39
+ "any": [
40
+ {
41
+ "kind": "member_expression",
42
+ "all": [
43
+ {
44
+ "has": {
45
+ "field": "object",
46
+ "kind": "identifier"
47
+ }
48
+ },
49
+ {
50
+ "has": {
51
+ "field": "property",
52
+ "regex": "^(?:component|mixin)$"
53
+ }
54
+ }
55
+ ]
56
+ },
57
+ {
58
+ "kind": "member_expression",
59
+ "all": [
60
+ {
61
+ "has": {
62
+ "field": "object",
63
+ "kind": "identifier",
64
+ "regex": "^Vue$"
65
+ }
66
+ },
67
+ {
68
+ "has": {
69
+ "field": "property",
70
+ "regex": "^extend$"
71
+ }
72
+ }
73
+ ]
74
+ },
75
+ {
76
+ "kind": "identifier",
77
+ "regex": "^defineNuxtComponent$"
78
+ },
79
+ {
80
+ "kind": "identifier",
81
+ "regex": "^(?:component|createApp|defineComponent)$",
82
+ "resolves": {
83
+ "binding": {
84
+ "site": {
85
+ "kind": "import_specifier",
86
+ "inside": {
87
+ "stopBy": "end",
88
+ "kind": "import_statement",
89
+ "has": {
90
+ "field": "source",
91
+ "kind": "string",
92
+ "value": {
93
+ "regex": "^(?:vue|@vue/composition-api|@nuxtjs/composition-api|#imports)$"
94
+ }
95
+ }
96
+ }
97
+ }
98
+ }
99
+ }
100
+ }
101
+ ]
102
+ },
103
+ "vue-object": {
104
+ "kind": "object",
105
+ "any": [
106
+ {
107
+ "all": [
108
+ {
109
+ "inside": {
110
+ "field": "value",
111
+ "stopBy": {
112
+ "not": {
113
+ "any": [
114
+ {
115
+ "kind": "parenthesized_expression"
116
+ },
117
+ {
118
+ "kind": "as_expression"
119
+ },
120
+ {
121
+ "kind": "satisfies_expression"
122
+ }
123
+ ]
124
+ }
125
+ },
126
+ "kind": "export_statement"
127
+ }
128
+ },
129
+ {
130
+ "not": {
131
+ "matches": "in-script-setup"
132
+ }
133
+ }
134
+ ]
135
+ },
136
+ {
137
+ "all": [
138
+ {
139
+ "nthChild": {
140
+ "position": 1,
141
+ "reverse": true
142
+ }
143
+ },
144
+ {
145
+ "inside": {
146
+ "stopBy": "neighbor",
147
+ "kind": "arguments",
148
+ "inside": {
149
+ "stopBy": "neighbor",
150
+ "kind": "call_expression",
151
+ "has": {
152
+ "field": "function",
153
+ "matches": "component-callee"
154
+ }
155
+ }
156
+ }
157
+ }
158
+ ]
159
+ },
160
+ {
161
+ "all": [
162
+ {
163
+ "nthChild": 1
164
+ },
165
+ {
166
+ "inside": {
167
+ "stopBy": "neighbor",
168
+ "kind": "arguments",
169
+ "inside": {
170
+ "stopBy": "neighbor",
171
+ "kind": "new_expression",
172
+ "has": {
173
+ "field": "constructor",
174
+ "kind": "identifier",
175
+ "regex": "^Vue$"
176
+ }
177
+ }
178
+ }
179
+ }
180
+ ]
181
+ }
182
+ ]
183
+ },
184
+ "setup-fn": {
185
+ "any": [
186
+ {
187
+ "kind": "method_definition",
188
+ "has": {
189
+ "field": "name",
190
+ "regex": "^(?:setup|'setup'|\"setup\")$"
191
+ },
192
+ "inside": {
193
+ "stopBy": "neighbor",
194
+ "kind": "object",
195
+ "matches": "vue-object"
196
+ }
197
+ },
198
+ {
199
+ "any": [
200
+ {
201
+ "kind": "function_expression"
202
+ },
203
+ {
204
+ "kind": "arrow_function"
205
+ }
206
+ ],
207
+ "inside": {
208
+ "stopBy": "neighbor",
209
+ "field": "value",
210
+ "kind": "pair",
211
+ "has": {
212
+ "field": "key",
213
+ "regex": "^(?:setup|'setup'|\"setup\")$"
214
+ },
215
+ "inside": {
216
+ "stopBy": "neighbor",
217
+ "kind": "object",
218
+ "matches": "vue-object"
219
+ }
220
+ }
221
+ }
222
+ ]
223
+ },
224
+ "ref-callee": {
225
+ "any": [
226
+ {
227
+ "kind": "identifier",
228
+ "resolves": {
229
+ "binding": {
230
+ "site": {
231
+ "kind": "import_specifier",
232
+ "has": {
233
+ "field": "name",
234
+ "regex": "^(?:ref|computed|toRef|customRef|shallowRef)$",
235
+ "pattern": "$M"
236
+ },
237
+ "inside": {
238
+ "stopBy": "end",
239
+ "kind": "import_statement",
240
+ "has": {
241
+ "field": "source",
242
+ "kind": "string",
243
+ "value": {
244
+ "regex": "^(?:vue|@vue/composition-api|@nuxtjs/composition-api|#imports)$"
245
+ }
246
+ }
247
+ }
248
+ }
249
+ }
250
+ }
251
+ },
252
+ {
253
+ "kind": "member_expression",
254
+ "all": [
255
+ {
256
+ "has": {
257
+ "field": "property",
258
+ "regex": "^(?:ref|computed|toRef|customRef|shallowRef)$",
259
+ "pattern": "$M"
260
+ }
261
+ },
262
+ {
263
+ "has": {
264
+ "field": "object",
265
+ "kind": "identifier",
266
+ "resolves": {
267
+ "binding": {
268
+ "site": {
269
+ "kind": "namespace_import",
270
+ "inside": {
271
+ "stopBy": "end",
272
+ "kind": "import_statement",
273
+ "has": {
274
+ "field": "source",
275
+ "kind": "string",
276
+ "value": {
277
+ "regex": "^(?:vue|@vue/composition-api|@nuxtjs/composition-api|#imports)$"
278
+ }
279
+ }
280
+ }
281
+ }
282
+ }
283
+ }
284
+ }
285
+ }
286
+ ]
287
+ }
288
+ ]
289
+ },
290
+ "torefs-callee": {
291
+ "any": [
292
+ {
293
+ "kind": "identifier",
294
+ "resolves": {
295
+ "binding": {
296
+ "site": {
297
+ "kind": "import_specifier",
298
+ "has": {
299
+ "field": "name",
300
+ "regex": "^toRefs$",
301
+ "pattern": "$M"
302
+ },
303
+ "inside": {
304
+ "stopBy": "end",
305
+ "kind": "import_statement",
306
+ "has": {
307
+ "field": "source",
308
+ "kind": "string",
309
+ "value": {
310
+ "regex": "^(?:vue|@vue/composition-api|@nuxtjs/composition-api|#imports)$"
311
+ }
312
+ }
313
+ }
314
+ }
315
+ }
316
+ }
317
+ },
318
+ {
319
+ "kind": "member_expression",
320
+ "all": [
321
+ {
322
+ "has": {
323
+ "field": "property",
324
+ "regex": "^toRefs$",
325
+ "pattern": "$M"
326
+ }
327
+ },
328
+ {
329
+ "has": {
330
+ "field": "object",
331
+ "kind": "identifier",
332
+ "resolves": {
333
+ "binding": {
334
+ "site": {
335
+ "kind": "namespace_import",
336
+ "inside": {
337
+ "stopBy": "end",
338
+ "kind": "import_statement",
339
+ "has": {
340
+ "field": "source",
341
+ "kind": "string",
342
+ "value": {
343
+ "regex": "^(?:vue|@vue/composition-api|@nuxtjs/composition-api|#imports)$"
344
+ }
345
+ }
346
+ }
347
+ }
348
+ }
349
+ }
350
+ }
351
+ }
352
+ ]
353
+ }
354
+ ]
355
+ },
356
+ "model-callee": {
357
+ "kind": "identifier",
358
+ "regex": "^defineModel$",
359
+ "pattern": "$M",
360
+ "resolves": {
361
+ "unresolved": true
362
+ }
363
+ },
364
+ "ref-value": {
365
+ "any": [
366
+ {
367
+ "kind": "call_expression",
368
+ "has": {
369
+ "field": "function",
370
+ "matches": "ref-callee"
371
+ }
372
+ },
373
+ {
374
+ "kind": "call_expression",
375
+ "has": {
376
+ "field": "function",
377
+ "matches": "model-callee"
378
+ }
379
+ },
380
+ {
381
+ "kind": "parenthesized_expression",
382
+ "has": {
383
+ "stopBy": "neighbor",
384
+ "matches": "ref-value"
385
+ }
386
+ },
387
+ {
388
+ "kind": "identifier",
389
+ "pattern": "$A",
390
+ "matches": {
391
+ "ref-var": {
392
+ "X": "$A",
393
+ "M": "$M"
394
+ }
395
+ }
396
+ }
397
+ ]
398
+ },
399
+ "ref-var": {
400
+ "params": [
401
+ "X",
402
+ "M"
403
+ ],
404
+ "rule": {
405
+ "kind": "identifier",
406
+ "pattern": "$X",
407
+ "any": [
408
+ {
409
+ "matches": {
410
+ "ref-declared": {
411
+ "X": "$X",
412
+ "M": "$M"
413
+ }
414
+ }
415
+ },
416
+ {
417
+ "resolves": {
418
+ "binding": {
419
+ "occurrence": {
420
+ "kind": "identifier",
421
+ "inside": {
422
+ "stopBy": "neighbor",
423
+ "field": "left",
424
+ "kind": "assignment_expression",
425
+ "has": {
426
+ "field": "right",
427
+ "matches": "ref-value"
428
+ }
429
+ }
430
+ }
431
+ }
432
+ }
433
+ }
434
+ ]
435
+ }
436
+ },
437
+ "ref-declared": {
438
+ "params": [
439
+ "X",
440
+ "M"
441
+ ],
442
+ "rule": {
443
+ "kind": "identifier",
444
+ "pattern": "$X",
445
+ "resolves": {
446
+ "binding": {
447
+ "site": {
448
+ "kind": "variable_declarator",
449
+ "any": [
450
+ {
451
+ "all": [
452
+ {
453
+ "has": {
454
+ "field": "name",
455
+ "kind": "identifier"
456
+ }
457
+ },
458
+ {
459
+ "has": {
460
+ "field": "value",
461
+ "matches": "ref-value"
462
+ }
463
+ }
464
+ ]
465
+ },
466
+ {
467
+ "all": [
468
+ {
469
+ "has": {
470
+ "field": "name",
471
+ "kind": "array_pattern",
472
+ "has": {
473
+ "kind": "identifier",
474
+ "pattern": "$E",
475
+ "compare": {
476
+ "left": "E",
477
+ "op": "eq",
478
+ "right": "X"
479
+ },
480
+ "follows": {
481
+ "stopBy": "neighbor",
482
+ "regex": "^\\[$"
483
+ }
484
+ }
485
+ }
486
+ },
487
+ {
488
+ "has": {
489
+ "field": "value",
490
+ "kind": "call_expression",
491
+ "has": {
492
+ "field": "function",
493
+ "matches": "model-callee"
494
+ }
495
+ }
496
+ }
497
+ ]
498
+ },
499
+ {
500
+ "all": [
501
+ {
502
+ "has": {
503
+ "field": "name",
504
+ "kind": "object_pattern",
505
+ "has": {
506
+ "any": [
507
+ {
508
+ "kind": "shorthand_property_identifier_pattern",
509
+ "pattern": "$E",
510
+ "compare": {
511
+ "left": "E",
512
+ "op": "eq",
513
+ "right": "X"
514
+ }
515
+ },
516
+ {
517
+ "kind": "pair_pattern",
518
+ "has": {
519
+ "field": "value",
520
+ "kind": "identifier",
521
+ "pattern": "$E",
522
+ "compare": {
523
+ "left": "E",
524
+ "op": "eq",
525
+ "right": "X"
526
+ }
527
+ }
528
+ }
529
+ ]
530
+ }
531
+ }
532
+ },
533
+ {
534
+ "has": {
535
+ "field": "value",
536
+ "kind": "call_expression",
537
+ "has": {
538
+ "field": "function",
539
+ "matches": "torefs-callee"
540
+ }
541
+ }
542
+ }
543
+ ]
544
+ }
545
+ ]
546
+ }
547
+ }
548
+ }
549
+ }
550
+ },
551
+ "setup-param2": {
552
+ "any": [
553
+ {
554
+ "nthChild": 2,
555
+ "inside": {
556
+ "stopBy": "neighbor",
557
+ "kind": "formal_parameters",
558
+ "inside": {
559
+ "stopBy": "neighbor",
560
+ "matches": "setup-fn"
561
+ }
562
+ }
563
+ },
564
+ {
565
+ "inside": {
566
+ "stopBy": {
567
+ "kind": "formal_parameters"
568
+ },
569
+ "nthChild": 2,
570
+ "inside": {
571
+ "stopBy": "neighbor",
572
+ "kind": "formal_parameters",
573
+ "inside": {
574
+ "stopBy": "neighbor",
575
+ "matches": "setup-fn"
576
+ }
577
+ }
578
+ }
579
+ }
580
+ ]
581
+ },
582
+ "emits-fn": {
583
+ "kind": "identifier",
584
+ "pattern": "$C",
585
+ "resolves": {
586
+ "binding": {
587
+ "site": {
588
+ "kind": "variable_declarator",
589
+ "all": [
590
+ {
591
+ "has": {
592
+ "field": "name",
593
+ "kind": "identifier"
594
+ }
595
+ },
596
+ {
597
+ "has": {
598
+ "field": "value",
599
+ "kind": "call_expression",
600
+ "has": {
601
+ "field": "function",
602
+ "kind": "identifier",
603
+ "regex": "^defineEmits$"
604
+ }
605
+ }
606
+ },
607
+ {
608
+ "matches": "in-script-setup"
609
+ }
610
+ ]
611
+ }
612
+ }
613
+ }
614
+ },
615
+ "emit-param": {
616
+ "kind": "identifier",
617
+ "pattern": "$C",
618
+ "resolves": {
619
+ "binding": {
620
+ "site": {
621
+ "matches": "setup-param2",
622
+ "any": [
623
+ {
624
+ "kind": "object_pattern",
625
+ "has": {
626
+ "any": [
627
+ {
628
+ "kind": "shorthand_property_identifier_pattern",
629
+ "regex": "^emit$",
630
+ "pattern": "$E",
631
+ "compare": {
632
+ "left": "E",
633
+ "op": "eq",
634
+ "right": "C"
635
+ }
636
+ },
637
+ {
638
+ "kind": "pair_pattern",
639
+ "all": [
640
+ {
641
+ "has": {
642
+ "field": "key",
643
+ "regex": "^(?:emit|'emit'|\"emit\")$"
644
+ }
645
+ },
646
+ {
647
+ "has": {
648
+ "field": "value",
649
+ "kind": "identifier",
650
+ "pattern": "$E",
651
+ "compare": {
652
+ "left": "E",
653
+ "op": "eq",
654
+ "right": "C"
655
+ }
656
+ }
657
+ }
658
+ ]
659
+ }
660
+ ]
661
+ }
662
+ },
663
+ {
664
+ "has": {
665
+ "stopBy": "end",
666
+ "kind": "object_pattern",
667
+ "has": {
668
+ "any": [
669
+ {
670
+ "kind": "shorthand_property_identifier_pattern",
671
+ "regex": "^emit$",
672
+ "pattern": "$E",
673
+ "compare": {
674
+ "left": "E",
675
+ "op": "eq",
676
+ "right": "C"
677
+ }
678
+ },
679
+ {
680
+ "kind": "pair_pattern",
681
+ "all": [
682
+ {
683
+ "has": {
684
+ "field": "key",
685
+ "regex": "^(?:emit|'emit'|\"emit\")$"
686
+ }
687
+ },
688
+ {
689
+ "has": {
690
+ "field": "value",
691
+ "kind": "identifier",
692
+ "pattern": "$E",
693
+ "compare": {
694
+ "left": "E",
695
+ "op": "eq",
696
+ "right": "C"
697
+ }
698
+ }
699
+ }
700
+ ]
701
+ }
702
+ ]
703
+ }
704
+ }
705
+ },
706
+ {
707
+ "kind": "shorthand_property_identifier_pattern",
708
+ "regex": "^emit$",
709
+ "pattern": "$E",
710
+ "compare": {
711
+ "left": "E",
712
+ "op": "eq",
713
+ "right": "C"
714
+ }
715
+ },
716
+ {
717
+ "kind": "identifier",
718
+ "pattern": "$E",
719
+ "compare": {
720
+ "left": "E",
721
+ "op": "eq",
722
+ "right": "C"
723
+ },
724
+ "inside": {
725
+ "stopBy": "neighbor",
726
+ "kind": "pair_pattern",
727
+ "has": {
728
+ "field": "key",
729
+ "regex": "^(?:emit|'emit'|\"emit\")$"
730
+ }
731
+ }
732
+ }
733
+ ]
734
+ }
735
+ }
736
+ }
737
+ },
738
+ "emit-member": {
739
+ "any": [
740
+ {
741
+ "kind": "member_expression",
742
+ "all": [
743
+ {
744
+ "has": {
745
+ "field": "property",
746
+ "regex": "^emit$"
747
+ }
748
+ },
749
+ {
750
+ "has": {
751
+ "field": "object",
752
+ "kind": "identifier",
753
+ "resolves": {
754
+ "binding": {
755
+ "site": {
756
+ "matches": "setup-param2"
757
+ }
758
+ }
759
+ }
760
+ }
761
+ }
762
+ ]
763
+ },
764
+ {
765
+ "kind": "subscript_expression",
766
+ "all": [
767
+ {
768
+ "has": {
769
+ "field": "index",
770
+ "kind": "string",
771
+ "value": {
772
+ "eq": "emit"
773
+ }
774
+ }
775
+ },
776
+ {
777
+ "has": {
778
+ "field": "object",
779
+ "kind": "identifier",
780
+ "resolves": {
781
+ "binding": {
782
+ "site": {
783
+ "matches": "setup-param2"
784
+ }
785
+ }
786
+ }
787
+ }
788
+ }
789
+ ]
790
+ }
791
+ ]
792
+ }
793
+ }
794
+ }
795
+ },
796
+ {
797
+ "id": "operand",
798
+ "forbid": {
799
+ "ast": {
800
+ "language": "vue",
801
+ "embedded": "script-block",
802
+ "rule": {
803
+ "all": [
804
+ {
805
+ "kind": "identifier"
806
+ },
807
+ {
808
+ "pattern": "$R"
809
+ },
810
+ {
811
+ "not": {
812
+ "inside": {
813
+ "stopBy": "end",
814
+ "kind": "statement_block",
815
+ "host": {
816
+ "kind": "template_element"
817
+ }
818
+ }
819
+ }
820
+ },
821
+ {
822
+ "matches": {
823
+ "ref-declared": {
824
+ "X": "$R",
825
+ "M": "$M"
826
+ }
827
+ }
828
+ },
829
+ {
830
+ "any": [
831
+ {
832
+ "inside": {
833
+ "stopBy": {
834
+ "not": {
835
+ "kind": "parenthesized_expression"
836
+ }
837
+ },
838
+ "field": "condition",
839
+ "kind": "if_statement"
840
+ }
841
+ },
842
+ {
843
+ "inside": {
844
+ "stopBy": {
845
+ "not": {
846
+ "kind": "parenthesized_expression"
847
+ }
848
+ },
849
+ "field": "value",
850
+ "kind": "switch_statement"
851
+ }
852
+ },
853
+ {
854
+ "inside": {
855
+ "stopBy": {
856
+ "not": {
857
+ "kind": "parenthesized_expression"
858
+ }
859
+ },
860
+ "kind": "unary_expression"
861
+ }
862
+ },
863
+ {
864
+ "inside": {
865
+ "stopBy": {
866
+ "not": {
867
+ "kind": "parenthesized_expression"
868
+ }
869
+ },
870
+ "kind": "update_expression"
871
+ }
872
+ },
873
+ {
874
+ "inside": {
875
+ "stopBy": {
876
+ "not": {
877
+ "kind": "parenthesized_expression"
878
+ }
879
+ },
880
+ "kind": "binary_expression",
881
+ "not": {
882
+ "has": {
883
+ "field": "operator",
884
+ "regex": "^(?:&&|\\|\\||\\?\\?)$"
885
+ }
886
+ }
887
+ }
888
+ },
889
+ {
890
+ "all": [
891
+ {
892
+ "inside": {
893
+ "stopBy": {
894
+ "not": {
895
+ "kind": "parenthesized_expression"
896
+ }
897
+ },
898
+ "field": "left",
899
+ "kind": "binary_expression",
900
+ "has": {
901
+ "field": "operator",
902
+ "regex": "^(?:&&|\\|\\||\\?\\?)$"
903
+ }
904
+ }
905
+ },
906
+ {
907
+ "resolves": {
908
+ "binding": {
909
+ "site": {
910
+ "kind": "variable_declarator",
911
+ "inside": {
912
+ "stopBy": "neighbor",
913
+ "kind": "lexical_declaration",
914
+ "has": {
915
+ "field": "kind",
916
+ "regex": "^const$"
917
+ }
918
+ }
919
+ }
920
+ }
921
+ }
922
+ }
923
+ ]
924
+ },
925
+ {
926
+ "inside": {
927
+ "stopBy": {
928
+ "not": {
929
+ "kind": "parenthesized_expression"
930
+ }
931
+ },
932
+ "field": "left",
933
+ "kind": "assignment_expression"
934
+ }
935
+ },
936
+ {
937
+ "inside": {
938
+ "stopBy": {
939
+ "not": {
940
+ "kind": "parenthesized_expression"
941
+ }
942
+ },
943
+ "kind": "augmented_assignment_expression"
944
+ }
945
+ },
946
+ {
947
+ "inside": {
948
+ "stopBy": {
949
+ "not": {
950
+ "kind": "parenthesized_expression"
951
+ }
952
+ },
953
+ "field": "condition",
954
+ "kind": "ternary_expression"
955
+ }
956
+ },
957
+ {
958
+ "inside": {
959
+ "stopBy": {
960
+ "not": {
961
+ "kind": "parenthesized_expression"
962
+ }
963
+ },
964
+ "kind": "template_substitution",
965
+ "inside": {
966
+ "stopBy": "neighbor",
967
+ "kind": "template_string",
968
+ "not": {
969
+ "inside": {
970
+ "stopBy": "neighbor",
971
+ "kind": "call_expression"
972
+ }
973
+ }
974
+ }
975
+ }
976
+ },
977
+ {
978
+ "inside": {
979
+ "stopBy": {
980
+ "not": {
981
+ "kind": "parenthesized_expression"
982
+ }
983
+ },
984
+ "field": "object",
985
+ "kind": "member_expression",
986
+ "not": {
987
+ "has": {
988
+ "field": "property",
989
+ "regex": "^(?:value|effect)$"
990
+ }
991
+ }
992
+ }
993
+ },
994
+ {
995
+ "inside": {
996
+ "stopBy": {
997
+ "not": {
998
+ "kind": "parenthesized_expression"
999
+ }
1000
+ },
1001
+ "field": "object",
1002
+ "kind": "subscript_expression",
1003
+ "has": {
1004
+ "field": "index",
1005
+ "any": [
1006
+ {
1007
+ "kind": "number"
1008
+ },
1009
+ {
1010
+ "kind": "string",
1011
+ "not": {
1012
+ "value": {
1013
+ "regex": "^(?:value|effect)$"
1014
+ }
1015
+ }
1016
+ },
1017
+ {
1018
+ "kind": "template_string",
1019
+ "all": [
1020
+ {
1021
+ "not": {
1022
+ "has": {
1023
+ "kind": "template_substitution"
1024
+ }
1025
+ }
1026
+ },
1027
+ {
1028
+ "not": {
1029
+ "value": {
1030
+ "regex": "^(?:value|effect)$"
1031
+ }
1032
+ }
1033
+ }
1034
+ ]
1035
+ }
1036
+ ]
1037
+ }
1038
+ }
1039
+ }
1040
+ ]
1041
+ }
1042
+ ]
1043
+ }
1044
+ }
1045
+ },
1046
+ "violation": {
1047
+ "anchor": "witness.span",
1048
+ "code": "vue/no-ref-as-operand",
1049
+ "message": "Must use `.value` to read or write the value wrapped by `$M()`.",
1050
+ "suppress": {
1051
+ "eslint": {
1052
+ "rules": [
1053
+ "vue/no-ref-as-operand"
1054
+ ]
1055
+ }
1056
+ }
1057
+ }
1058
+ },
1059
+ {
1060
+ "id": "emit-argument",
1061
+ "forbid": {
1062
+ "ast": {
1063
+ "language": "vue",
1064
+ "embedded": "script-block",
1065
+ "rule": {
1066
+ "all": [
1067
+ {
1068
+ "kind": "identifier"
1069
+ },
1070
+ {
1071
+ "pattern": "$R"
1072
+ },
1073
+ {
1074
+ "not": {
1075
+ "inside": {
1076
+ "stopBy": "end",
1077
+ "kind": "statement_block",
1078
+ "host": {
1079
+ "kind": "template_element"
1080
+ }
1081
+ }
1082
+ }
1083
+ },
1084
+ {
1085
+ "matches": {
1086
+ "ref-declared": {
1087
+ "X": "$R",
1088
+ "M": "$M"
1089
+ }
1090
+ }
1091
+ },
1092
+ {
1093
+ "inside": {
1094
+ "stopBy": "neighbor",
1095
+ "kind": "arguments",
1096
+ "has": {
1097
+ "nthChild": 1,
1098
+ "any": [
1099
+ {
1100
+ "kind": "string"
1101
+ },
1102
+ {
1103
+ "kind": "template_string",
1104
+ "not": {
1105
+ "has": {
1106
+ "kind": "template_substitution"
1107
+ }
1108
+ }
1109
+ }
1110
+ ]
1111
+ },
1112
+ "inside": {
1113
+ "stopBy": "neighbor",
1114
+ "kind": "call_expression",
1115
+ "any": [
1116
+ {
1117
+ "all": [
1118
+ {
1119
+ "matches": "in-script-setup"
1120
+ },
1121
+ {
1122
+ "has": {
1123
+ "field": "function",
1124
+ "matches": "emits-fn"
1125
+ }
1126
+ }
1127
+ ]
1128
+ },
1129
+ {
1130
+ "has": {
1131
+ "field": "function",
1132
+ "any": [
1133
+ {
1134
+ "matches": "emit-param"
1135
+ },
1136
+ {
1137
+ "matches": "emit-member"
1138
+ }
1139
+ ]
1140
+ }
1141
+ }
1142
+ ]
1143
+ }
1144
+ }
1145
+ }
1146
+ ]
1147
+ }
1148
+ }
1149
+ },
1150
+ "violation": {
1151
+ "anchor": "witness.span",
1152
+ "code": "vue/no-ref-as-operand",
1153
+ "message": "Must use `.value` to read or write the value wrapped by `$M()`.",
1154
+ "suppress": {
1155
+ "eslint": {
1156
+ "rules": [
1157
+ "vue/no-ref-as-operand"
1158
+ ]
1159
+ }
1160
+ }
1161
+ }
1162
+ }
1163
+ ]
1164
+ }