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