@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,1749 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "eslint-plugin-vue-no-async-in-computed-properties",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Keep Vue computed properties synchronous, with no async getter, await, promises, nextTick or timers; a computed must return its value right away.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*.vue"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "shared",
16
+ "define": {
17
+ "language": "vue",
18
+ "utils": {
19
+ "fn-like": {
20
+ "any": [
21
+ {
22
+ "kind": "function_declaration"
23
+ },
24
+ {
25
+ "kind": "function_expression"
26
+ },
27
+ {
28
+ "kind": "arrow_function"
29
+ },
30
+ {
31
+ "kind": "generator_function"
32
+ },
33
+ {
34
+ "kind": "generator_function_declaration"
35
+ },
36
+ {
37
+ "kind": "method_definition"
38
+ }
39
+ ]
40
+ },
41
+ "fn-expr": {
42
+ "any": [
43
+ {
44
+ "kind": "function_expression"
45
+ },
46
+ {
47
+ "kind": "generator_function"
48
+ }
49
+ ]
50
+ },
51
+ "paren-as": {
52
+ "any": [
53
+ {
54
+ "kind": "parenthesized_expression"
55
+ },
56
+ {
57
+ "kind": "as_expression"
58
+ }
59
+ ]
60
+ },
61
+ "setup-marker": {
62
+ "kind": "empty_statement",
63
+ "host": {
64
+ "kind": "start_tag",
65
+ "regex": "^<script(?:\\s+[^\\s\"'<>/=]+(?:\\s*=\\s*(?:\"[^\"]*\"|'[^']*'|[^\\s\"'<>=`]+))?)*\\s+setup(?:[\\s/>=]|$)"
66
+ }
67
+ },
68
+ "any-marker": {
69
+ "kind": "empty_statement",
70
+ "host": {
71
+ "kind": "start_tag",
72
+ "regex": "^<script\\b"
73
+ }
74
+ },
75
+ "top-in-setup": {
76
+ "all": [
77
+ {
78
+ "inside": {
79
+ "stopBy": "neighbor",
80
+ "kind": "program"
81
+ }
82
+ },
83
+ {
84
+ "follows": {
85
+ "stopBy": {
86
+ "matches": "any-marker"
87
+ },
88
+ "matches": "setup-marker"
89
+ }
90
+ }
91
+ ]
92
+ },
93
+ "in-setup": {
94
+ "any": [
95
+ {
96
+ "matches": "top-in-setup"
97
+ },
98
+ {
99
+ "inside": {
100
+ "stopBy": "end",
101
+ "matches": "top-in-setup"
102
+ }
103
+ }
104
+ ]
105
+ },
106
+ "file-setup": {
107
+ "inside": {
108
+ "stopBy": "end",
109
+ "kind": "program",
110
+ "has": {
111
+ "stopBy": "neighbor",
112
+ "matches": "setup-marker"
113
+ }
114
+ }
115
+ },
116
+ "file-plain": {
117
+ "not": {
118
+ "matches": "file-setup"
119
+ }
120
+ },
121
+ "key-computed": {
122
+ "any": [
123
+ {
124
+ "regex": "^(?:computed|'computed'|\"computed\")$",
125
+ "not": {
126
+ "kind": "computed_property_name"
127
+ }
128
+ },
129
+ {
130
+ "kind": "computed_property_name",
131
+ "has": {
132
+ "stopBy": "neighbor",
133
+ "kind": "string",
134
+ "regex": "^(?:'computed'|\"computed\")$"
135
+ }
136
+ }
137
+ ]
138
+ },
139
+ "key-get": {
140
+ "any": [
141
+ {
142
+ "regex": "^(?:get|'get'|\"get\")$",
143
+ "not": {
144
+ "kind": "computed_property_name"
145
+ }
146
+ },
147
+ {
148
+ "kind": "computed_property_name",
149
+ "has": {
150
+ "stopBy": "neighbor",
151
+ "kind": "string",
152
+ "regex": "^(?:'get'|\"get\")$"
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ "last-arg": {
158
+ "any": [
159
+ {
160
+ "all": [
161
+ {
162
+ "inside": {
163
+ "stopBy": "neighbor",
164
+ "kind": "arguments"
165
+ }
166
+ },
167
+ {
168
+ "nthChild": {
169
+ "position": 1,
170
+ "reverse": true,
171
+ "ofRule": {
172
+ "not": {
173
+ "kind": "comment"
174
+ }
175
+ }
176
+ }
177
+ }
178
+ ]
179
+ },
180
+ {
181
+ "inside": {
182
+ "stopBy": "neighbor",
183
+ "all": [
184
+ {
185
+ "matches": "paren-as"
186
+ },
187
+ {
188
+ "matches": "last-arg"
189
+ }
190
+ ]
191
+ }
192
+ }
193
+ ]
194
+ },
195
+ "first-arg": {
196
+ "any": [
197
+ {
198
+ "all": [
199
+ {
200
+ "inside": {
201
+ "stopBy": "neighbor",
202
+ "kind": "arguments"
203
+ }
204
+ },
205
+ {
206
+ "nthChild": {
207
+ "position": 1,
208
+ "ofRule": {
209
+ "not": {
210
+ "kind": "comment"
211
+ }
212
+ }
213
+ }
214
+ }
215
+ ]
216
+ },
217
+ {
218
+ "inside": {
219
+ "stopBy": "neighbor",
220
+ "all": [
221
+ {
222
+ "matches": "paren-as"
223
+ },
224
+ {
225
+ "matches": "first-arg"
226
+ }
227
+ ]
228
+ }
229
+ }
230
+ ]
231
+ },
232
+ "define-callee": {
233
+ "any": [
234
+ {
235
+ "kind": "member_expression",
236
+ "all": [
237
+ {
238
+ "has": {
239
+ "field": "object",
240
+ "kind": "identifier"
241
+ }
242
+ },
243
+ {
244
+ "has": {
245
+ "field": "property",
246
+ "regex": "^(?:component|mixin)$"
247
+ }
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ "kind": "member_expression",
253
+ "all": [
254
+ {
255
+ "has": {
256
+ "field": "object",
257
+ "kind": "identifier",
258
+ "regex": "^Vue$"
259
+ }
260
+ },
261
+ {
262
+ "has": {
263
+ "field": "property",
264
+ "regex": "^extend$"
265
+ }
266
+ }
267
+ ]
268
+ },
269
+ {
270
+ "kind": "identifier",
271
+ "regex": "^defineNuxtComponent$"
272
+ },
273
+ {
274
+ "kind": "identifier",
275
+ "regex": "^(?:component|createApp|defineComponent)$",
276
+ "not": {
277
+ "resolves": {
278
+ "binding": {
279
+ "site": {
280
+ "any": [
281
+ {
282
+ "kind": "import_specifier",
283
+ "not": {
284
+ "inside": {
285
+ "stopBy": "end",
286
+ "kind": "import_statement",
287
+ "has": {
288
+ "field": "source",
289
+ "kind": "string",
290
+ "value": {
291
+ "regex": "^(?:vue|@vue/composition-api|@nuxtjs/composition-api|#imports)$"
292
+ }
293
+ }
294
+ }
295
+ }
296
+ },
297
+ {
298
+ "kind": "function_declaration"
299
+ },
300
+ {
301
+ "kind": "generator_function_declaration"
302
+ },
303
+ {
304
+ "kind": "class_declaration"
305
+ },
306
+ {
307
+ "kind": "catch_clause"
308
+ }
309
+ ]
310
+ }
311
+ }
312
+ }
313
+ }
314
+ }
315
+ ]
316
+ },
317
+ "vue-object": {
318
+ "kind": "object",
319
+ "any": [
320
+ {
321
+ "inside": {
322
+ "stopBy": {
323
+ "not": {
324
+ "kind": "parenthesized_expression"
325
+ }
326
+ },
327
+ "kind": "export_statement",
328
+ "not": {
329
+ "matches": "top-in-setup"
330
+ }
331
+ }
332
+ },
333
+ {
334
+ "all": [
335
+ {
336
+ "matches": "last-arg"
337
+ },
338
+ {
339
+ "inside": {
340
+ "stopBy": {
341
+ "not": {
342
+ "matches": "paren-as"
343
+ }
344
+ },
345
+ "kind": "arguments",
346
+ "inside": {
347
+ "stopBy": "neighbor",
348
+ "kind": "call_expression",
349
+ "has": {
350
+ "field": "function",
351
+ "matches": "define-callee"
352
+ }
353
+ }
354
+ }
355
+ }
356
+ ]
357
+ },
358
+ {
359
+ "all": [
360
+ {
361
+ "matches": "first-arg"
362
+ },
363
+ {
364
+ "inside": {
365
+ "stopBy": {
366
+ "not": {
367
+ "matches": "paren-as"
368
+ }
369
+ },
370
+ "kind": "arguments",
371
+ "inside": {
372
+ "stopBy": "neighbor",
373
+ "kind": "new_expression",
374
+ "has": {
375
+ "field": "constructor",
376
+ "kind": "identifier",
377
+ "regex": "^Vue$"
378
+ }
379
+ }
380
+ }
381
+ }
382
+ ]
383
+ },
384
+ {
385
+ "not": {
386
+ "not": {
387
+ "all": [
388
+ {
389
+ "pattern": "$VUEOBJ"
390
+ },
391
+ {
392
+ "inside": {
393
+ "stopBy": "end",
394
+ "kind": "program",
395
+ "has": {
396
+ "stopBy": "end",
397
+ "kind": "comment",
398
+ "regex": "@vue/component",
399
+ "layout": {
400
+ "after": {
401
+ "to": "capture.VUEOBJ",
402
+ "breaks": {
403
+ "eq": 1
404
+ }
405
+ }
406
+ }
407
+ }
408
+ }
409
+ }
410
+ ]
411
+ }
412
+ }
413
+ }
414
+ ]
415
+ },
416
+ "computed-object": {
417
+ "kind": "object",
418
+ "inside": {
419
+ "field": "value",
420
+ "stopBy": "neighbor",
421
+ "kind": "pair",
422
+ "all": [
423
+ {
424
+ "has": {
425
+ "field": "key",
426
+ "matches": "key-computed"
427
+ }
428
+ },
429
+ {
430
+ "inside": {
431
+ "stopBy": "neighbor",
432
+ "matches": "vue-object"
433
+ }
434
+ }
435
+ ]
436
+ }
437
+ },
438
+ "opt-getter": {
439
+ "any": [
440
+ {
441
+ "kind": "method_definition",
442
+ "all": [
443
+ {
444
+ "has": {
445
+ "field": "name",
446
+ "pattern": "$K"
447
+ }
448
+ },
449
+ {
450
+ "inside": {
451
+ "stopBy": "neighbor",
452
+ "matches": "computed-object"
453
+ }
454
+ }
455
+ ]
456
+ },
457
+ {
458
+ "all": [
459
+ {
460
+ "matches": "fn-expr"
461
+ },
462
+ {
463
+ "inside": {
464
+ "stopBy": {
465
+ "not": {
466
+ "matches": "paren-as"
467
+ }
468
+ },
469
+ "kind": "pair",
470
+ "all": [
471
+ {
472
+ "has": {
473
+ "field": "key",
474
+ "pattern": "$K"
475
+ }
476
+ },
477
+ {
478
+ "inside": {
479
+ "stopBy": "neighbor",
480
+ "matches": "computed-object"
481
+ }
482
+ }
483
+ ]
484
+ }
485
+ }
486
+ ]
487
+ },
488
+ {
489
+ "kind": "method_definition",
490
+ "all": [
491
+ {
492
+ "has": {
493
+ "field": "name",
494
+ "matches": "key-get"
495
+ }
496
+ },
497
+ {
498
+ "inside": {
499
+ "stopBy": "neighbor",
500
+ "kind": "object",
501
+ "inside": {
502
+ "stopBy": {
503
+ "not": {
504
+ "matches": "paren-as"
505
+ }
506
+ },
507
+ "kind": "pair",
508
+ "all": [
509
+ {
510
+ "has": {
511
+ "field": "key",
512
+ "pattern": "$K"
513
+ }
514
+ },
515
+ {
516
+ "inside": {
517
+ "stopBy": "neighbor",
518
+ "matches": "computed-object"
519
+ }
520
+ }
521
+ ]
522
+ }
523
+ }
524
+ }
525
+ ]
526
+ },
527
+ {
528
+ "all": [
529
+ {
530
+ "matches": "fn-expr"
531
+ },
532
+ {
533
+ "inside": {
534
+ "stopBy": {
535
+ "not": {
536
+ "kind": "parenthesized_expression"
537
+ }
538
+ },
539
+ "kind": "pair",
540
+ "all": [
541
+ {
542
+ "has": {
543
+ "field": "key",
544
+ "matches": "key-get"
545
+ }
546
+ },
547
+ {
548
+ "inside": {
549
+ "stopBy": "neighbor",
550
+ "kind": "object",
551
+ "inside": {
552
+ "stopBy": {
553
+ "not": {
554
+ "matches": "paren-as"
555
+ }
556
+ },
557
+ "kind": "pair",
558
+ "all": [
559
+ {
560
+ "has": {
561
+ "field": "key",
562
+ "pattern": "$K"
563
+ }
564
+ },
565
+ {
566
+ "inside": {
567
+ "stopBy": "neighbor",
568
+ "matches": "computed-object"
569
+ }
570
+ }
571
+ ]
572
+ }
573
+ }
574
+ }
575
+ ]
576
+ }
577
+ }
578
+ ]
579
+ }
580
+ ]
581
+ },
582
+ "computed-callee": {
583
+ "any": [
584
+ {
585
+ "kind": "identifier",
586
+ "resolves": {
587
+ "binding": {
588
+ "site": {
589
+ "kind": "import_specifier",
590
+ "all": [
591
+ {
592
+ "has": {
593
+ "field": "name",
594
+ "regex": "^computed$"
595
+ }
596
+ },
597
+ {
598
+ "inside": {
599
+ "stopBy": "end",
600
+ "kind": "import_statement",
601
+ "has": {
602
+ "field": "source",
603
+ "kind": "string",
604
+ "value": {
605
+ "regex": "^(?:vue|@vue/composition-api|@nuxtjs/composition-api|#imports)$"
606
+ }
607
+ }
608
+ }
609
+ }
610
+ ]
611
+ }
612
+ }
613
+ }
614
+ },
615
+ {
616
+ "kind": "member_expression",
617
+ "all": [
618
+ {
619
+ "has": {
620
+ "field": "property",
621
+ "regex": "^computed$"
622
+ }
623
+ },
624
+ {
625
+ "has": {
626
+ "field": "object",
627
+ "kind": "identifier",
628
+ "resolves": {
629
+ "binding": {
630
+ "site": {
631
+ "kind": "namespace_import",
632
+ "inside": {
633
+ "stopBy": "end",
634
+ "kind": "import_statement",
635
+ "has": {
636
+ "field": "source",
637
+ "kind": "string",
638
+ "value": {
639
+ "regex": "^(?:vue|@vue/composition-api|@nuxtjs/composition-api|#imports)$"
640
+ }
641
+ }
642
+ }
643
+ }
644
+ }
645
+ }
646
+ }
647
+ }
648
+ ]
649
+ }
650
+ ]
651
+ },
652
+ "computed-arg": {
653
+ "any": [
654
+ {
655
+ "all": [
656
+ {
657
+ "nthChild": {
658
+ "position": 1,
659
+ "ofRule": {
660
+ "not": {
661
+ "kind": "comment"
662
+ }
663
+ }
664
+ }
665
+ },
666
+ {
667
+ "inside": {
668
+ "stopBy": "neighbor",
669
+ "kind": "arguments",
670
+ "inside": {
671
+ "stopBy": "neighbor",
672
+ "kind": "call_expression",
673
+ "has": {
674
+ "field": "function",
675
+ "matches": "computed-callee"
676
+ }
677
+ }
678
+ }
679
+ }
680
+ ]
681
+ },
682
+ {
683
+ "inside": {
684
+ "stopBy": "neighbor",
685
+ "all": [
686
+ {
687
+ "kind": "parenthesized_expression"
688
+ },
689
+ {
690
+ "matches": "computed-arg"
691
+ }
692
+ ]
693
+ }
694
+ }
695
+ ]
696
+ },
697
+ "fn-or-arrow": {
698
+ "any": [
699
+ {
700
+ "matches": "fn-expr"
701
+ },
702
+ {
703
+ "kind": "arrow_function"
704
+ }
705
+ ]
706
+ },
707
+ "comp-getter": {
708
+ "any": [
709
+ {
710
+ "all": [
711
+ {
712
+ "matches": "fn-or-arrow"
713
+ },
714
+ {
715
+ "matches": "computed-arg"
716
+ }
717
+ ]
718
+ },
719
+ {
720
+ "kind": "method_definition",
721
+ "all": [
722
+ {
723
+ "has": {
724
+ "field": "name",
725
+ "matches": "key-get"
726
+ }
727
+ },
728
+ {
729
+ "inside": {
730
+ "stopBy": "neighbor",
731
+ "kind": "object",
732
+ "matches": "computed-arg"
733
+ }
734
+ }
735
+ ]
736
+ },
737
+ {
738
+ "all": [
739
+ {
740
+ "matches": "fn-or-arrow"
741
+ },
742
+ {
743
+ "inside": {
744
+ "stopBy": {
745
+ "not": {
746
+ "kind": "parenthesized_expression"
747
+ }
748
+ },
749
+ "kind": "pair",
750
+ "all": [
751
+ {
752
+ "has": {
753
+ "field": "key",
754
+ "matches": "key-get"
755
+ }
756
+ },
757
+ {
758
+ "inside": {
759
+ "stopBy": "neighbor",
760
+ "kind": "object",
761
+ "matches": "computed-arg"
762
+ }
763
+ }
764
+ ]
765
+ }
766
+ }
767
+ ]
768
+ }
769
+ ]
770
+ },
771
+ "in-vue-object": {
772
+ "inside": {
773
+ "stopBy": "end",
774
+ "matches": "vue-object"
775
+ }
776
+ },
777
+ "comp-ctx": {
778
+ "any": [
779
+ {
780
+ "all": [
781
+ {
782
+ "matches": "file-setup"
783
+ },
784
+ {
785
+ "matches": "in-setup"
786
+ }
787
+ ]
788
+ },
789
+ {
790
+ "all": [
791
+ {
792
+ "matches": "file-plain"
793
+ },
794
+ {
795
+ "matches": "in-vue-object"
796
+ }
797
+ ]
798
+ }
799
+ ]
800
+ },
801
+ "this-ish": {
802
+ "any": [
803
+ {
804
+ "kind": "this"
805
+ },
806
+ {
807
+ "kind": "identifier",
808
+ "resolves": {
809
+ "binding": {
810
+ "only": true,
811
+ "site": {
812
+ "kind": "variable_declarator",
813
+ "all": [
814
+ {
815
+ "has": {
816
+ "field": "name",
817
+ "kind": "identifier"
818
+ }
819
+ },
820
+ {
821
+ "has": {
822
+ "field": "value",
823
+ "kind": "this"
824
+ }
825
+ },
826
+ {
827
+ "inside": {
828
+ "stopBy": "neighbor",
829
+ "kind": "lexical_declaration",
830
+ "has": {
831
+ "stopBy": "neighbor",
832
+ "regex": "^const$"
833
+ }
834
+ }
835
+ }
836
+ ]
837
+ }
838
+ }
839
+ }
840
+ }
841
+ ]
842
+ },
843
+ "promise-callee": {
844
+ "any": [
845
+ {
846
+ "kind": "parenthesized_expression",
847
+ "has": {
848
+ "stopBy": "neighbor",
849
+ "matches": "promise-callee"
850
+ }
851
+ },
852
+ {
853
+ "any": [
854
+ {
855
+ "any": [
856
+ {
857
+ "kind": "member_expression",
858
+ "all": [
859
+ {
860
+ "has": {
861
+ "field": "property",
862
+ "kind": "property_identifier",
863
+ "regex": "^(?:then|catch|finally)$"
864
+ }
865
+ }
866
+ ]
867
+ },
868
+ {
869
+ "kind": "subscript_expression",
870
+ "all": [
871
+ {
872
+ "has": {
873
+ "field": "index",
874
+ "kind": "string",
875
+ "has": {
876
+ "stopBy": "neighbor",
877
+ "kind": "string_fragment",
878
+ "regex": "^(?:then|catch|finally)$"
879
+ }
880
+ }
881
+ }
882
+ ]
883
+ }
884
+ ]
885
+ },
886
+ {
887
+ "any": [
888
+ {
889
+ "kind": "member_expression",
890
+ "all": [
891
+ {
892
+ "has": {
893
+ "field": "object",
894
+ "kind": "identifier",
895
+ "regex": "^Promise$"
896
+ }
897
+ },
898
+ {
899
+ "has": {
900
+ "field": "property",
901
+ "kind": "property_identifier",
902
+ "regex": "^(?:all|allSettled|any|race|reject|resolve|try|withResolvers)$"
903
+ }
904
+ }
905
+ ]
906
+ },
907
+ {
908
+ "kind": "subscript_expression",
909
+ "all": [
910
+ {
911
+ "has": {
912
+ "field": "object",
913
+ "kind": "identifier",
914
+ "regex": "^Promise$"
915
+ }
916
+ },
917
+ {
918
+ "has": {
919
+ "field": "index",
920
+ "kind": "string",
921
+ "has": {
922
+ "stopBy": "neighbor",
923
+ "kind": "string_fragment",
924
+ "regex": "^(?:all|allSettled|any|race|reject|resolve|try|withResolvers)$"
925
+ }
926
+ }
927
+ }
928
+ ]
929
+ }
930
+ ]
931
+ }
932
+ ]
933
+ }
934
+ ]
935
+ },
936
+ "timed-callee": {
937
+ "any": [
938
+ {
939
+ "kind": "parenthesized_expression",
940
+ "has": {
941
+ "stopBy": "neighbor",
942
+ "matches": "timed-callee"
943
+ }
944
+ },
945
+ {
946
+ "any": [
947
+ {
948
+ "kind": "identifier",
949
+ "regex": "^(?:setTimeout|setInterval|setImmediate|requestAnimationFrame)$"
950
+ },
951
+ {
952
+ "any": [
953
+ {
954
+ "kind": "member_expression",
955
+ "all": [
956
+ {
957
+ "has": {
958
+ "field": "object",
959
+ "kind": "identifier",
960
+ "regex": "^window$"
961
+ }
962
+ },
963
+ {
964
+ "has": {
965
+ "field": "property",
966
+ "kind": "property_identifier",
967
+ "regex": "^(?:setTimeout|setInterval|setImmediate|requestAnimationFrame)$"
968
+ }
969
+ }
970
+ ]
971
+ },
972
+ {
973
+ "kind": "subscript_expression",
974
+ "all": [
975
+ {
976
+ "has": {
977
+ "field": "object",
978
+ "kind": "identifier",
979
+ "regex": "^window$"
980
+ }
981
+ },
982
+ {
983
+ "has": {
984
+ "field": "index",
985
+ "kind": "string",
986
+ "has": {
987
+ "stopBy": "neighbor",
988
+ "kind": "string_fragment",
989
+ "regex": "^(?:setTimeout|setInterval|setImmediate|requestAnimationFrame)$"
990
+ }
991
+ }
992
+ }
993
+ ]
994
+ }
995
+ ]
996
+ }
997
+ ]
998
+ }
999
+ ]
1000
+ },
1001
+ "nexttick-callee": {
1002
+ "any": [
1003
+ {
1004
+ "kind": "parenthesized_expression",
1005
+ "has": {
1006
+ "stopBy": "neighbor",
1007
+ "matches": "nexttick-callee"
1008
+ }
1009
+ },
1010
+ {
1011
+ "any": [
1012
+ {
1013
+ "any": [
1014
+ {
1015
+ "kind": "member_expression",
1016
+ "all": [
1017
+ {
1018
+ "has": {
1019
+ "field": "object",
1020
+ "matches": "this-ish"
1021
+ }
1022
+ },
1023
+ {
1024
+ "has": {
1025
+ "field": "property",
1026
+ "kind": "property_identifier",
1027
+ "regex": "^\\$nextTick$"
1028
+ }
1029
+ }
1030
+ ]
1031
+ },
1032
+ {
1033
+ "kind": "subscript_expression",
1034
+ "all": [
1035
+ {
1036
+ "has": {
1037
+ "field": "object",
1038
+ "matches": "this-ish"
1039
+ }
1040
+ },
1041
+ {
1042
+ "has": {
1043
+ "field": "index",
1044
+ "kind": "string",
1045
+ "has": {
1046
+ "stopBy": "neighbor",
1047
+ "kind": "string_fragment",
1048
+ "regex": "^\\$nextTick$"
1049
+ }
1050
+ }
1051
+ }
1052
+ ]
1053
+ }
1054
+ ]
1055
+ },
1056
+ {
1057
+ "any": [
1058
+ {
1059
+ "kind": "member_expression",
1060
+ "all": [
1061
+ {
1062
+ "has": {
1063
+ "field": "object",
1064
+ "kind": "identifier",
1065
+ "regex": "^Vue$"
1066
+ }
1067
+ },
1068
+ {
1069
+ "has": {
1070
+ "field": "property",
1071
+ "kind": "property_identifier",
1072
+ "regex": "^nextTick$"
1073
+ }
1074
+ }
1075
+ ]
1076
+ },
1077
+ {
1078
+ "kind": "subscript_expression",
1079
+ "all": [
1080
+ {
1081
+ "has": {
1082
+ "field": "object",
1083
+ "kind": "identifier",
1084
+ "regex": "^Vue$"
1085
+ }
1086
+ },
1087
+ {
1088
+ "has": {
1089
+ "field": "index",
1090
+ "kind": "string",
1091
+ "has": {
1092
+ "stopBy": "neighbor",
1093
+ "kind": "string_fragment",
1094
+ "regex": "^nextTick$"
1095
+ }
1096
+ }
1097
+ }
1098
+ ]
1099
+ }
1100
+ ]
1101
+ }
1102
+ ]
1103
+ }
1104
+ ]
1105
+ }
1106
+ }
1107
+ }
1108
+ },
1109
+ {
1110
+ "id": "async-function-in-options-getter",
1111
+ "forbid": {
1112
+ "ast": {
1113
+ "language": "vue",
1114
+ "embedded": "script-block",
1115
+ "rule": {
1116
+ "all": [
1117
+ {
1118
+ "any": [
1119
+ {
1120
+ "kind": "method_definition",
1121
+ "regex": "^async\\s+(?:\\*\\s*)?(?:[\\w$#]+|'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"|\\[[\\s\\S]*?\\])\\s*(?<A>[<(][\\s\\S]*)$"
1122
+ },
1123
+ {
1124
+ "all": [
1125
+ {
1126
+ "matches": "fn-or-arrow"
1127
+ },
1128
+ {
1129
+ "pattern": "$A"
1130
+ }
1131
+ ]
1132
+ }
1133
+ ]
1134
+ },
1135
+ {
1136
+ "matches": "opt-getter"
1137
+ },
1138
+ {
1139
+ "has": {
1140
+ "stopBy": "neighbor",
1141
+ "regex": "^async$",
1142
+ "not": {
1143
+ "any": [
1144
+ {
1145
+ "kind": "identifier"
1146
+ },
1147
+ {
1148
+ "kind": "property_identifier"
1149
+ }
1150
+ ]
1151
+ }
1152
+ }
1153
+ },
1154
+ {
1155
+ "matches": "file-plain"
1156
+ }
1157
+ ]
1158
+ },
1159
+ "transform": {
1160
+ "N1": {
1161
+ "replace": {
1162
+ "source": "$K",
1163
+ "replace": "^(?:\\[\\s*(?:'([^']*)'|\"([^\"]*)\")\\s*\\]|'([^']*)'|\"([^\"]*)\")$",
1164
+ "by": "${1}${2}${3}${4}"
1165
+ }
1166
+ },
1167
+ "NAME": {
1168
+ "replace": {
1169
+ "source": "$N1",
1170
+ "replace": "^\\[.*\\]$",
1171
+ "by": "Unknown"
1172
+ }
1173
+ }
1174
+ }
1175
+ }
1176
+ },
1177
+ "violation": {
1178
+ "anchor": "capture.A",
1179
+ "code": "vue/no-async-in-computed-properties",
1180
+ "message": "Make the \"$NAME\" computed getter synchronous and move the async work into a watcher or method.",
1181
+ "suppress": {
1182
+ "eslint": {
1183
+ "rules": [
1184
+ "vue/no-async-in-computed-properties"
1185
+ ]
1186
+ }
1187
+ }
1188
+ }
1189
+ },
1190
+ {
1191
+ "id": "async-function-in-composition-getter",
1192
+ "forbid": {
1193
+ "ast": {
1194
+ "language": "vue",
1195
+ "embedded": "script-block",
1196
+ "rule": {
1197
+ "all": [
1198
+ {
1199
+ "any": [
1200
+ {
1201
+ "kind": "method_definition",
1202
+ "any": [
1203
+ {
1204
+ "has": {
1205
+ "field": "type_parameters",
1206
+ "pattern": "$A"
1207
+ }
1208
+ },
1209
+ {
1210
+ "has": {
1211
+ "field": "parameters",
1212
+ "pattern": "$A"
1213
+ }
1214
+ }
1215
+ ]
1216
+ },
1217
+ {
1218
+ "all": [
1219
+ {
1220
+ "matches": "fn-or-arrow"
1221
+ },
1222
+ {
1223
+ "pattern": "$A"
1224
+ }
1225
+ ]
1226
+ }
1227
+ ]
1228
+ },
1229
+ {
1230
+ "matches": "comp-getter"
1231
+ },
1232
+ {
1233
+ "has": {
1234
+ "stopBy": "neighbor",
1235
+ "regex": "^async$",
1236
+ "not": {
1237
+ "any": [
1238
+ {
1239
+ "kind": "identifier"
1240
+ },
1241
+ {
1242
+ "kind": "property_identifier"
1243
+ }
1244
+ ]
1245
+ }
1246
+ }
1247
+ },
1248
+ {
1249
+ "matches": "comp-ctx"
1250
+ }
1251
+ ]
1252
+ }
1253
+ }
1254
+ },
1255
+ "violation": {
1256
+ "anchor": "capture.A",
1257
+ "code": "vue/no-async-in-computed-properties",
1258
+ "message": "Make this computed getter synchronous and move the async work into a watcher or function.",
1259
+ "suppress": {
1260
+ "eslint": {
1261
+ "rules": [
1262
+ "vue/no-async-in-computed-properties"
1263
+ ]
1264
+ }
1265
+ }
1266
+ }
1267
+ },
1268
+ {
1269
+ "id": "await-in-options-getter",
1270
+ "forbid": {
1271
+ "ast": {
1272
+ "language": "vue",
1273
+ "embedded": "script-block",
1274
+ "rule": {
1275
+ "all": [
1276
+ {
1277
+ "kind": "await_expression"
1278
+ },
1279
+ {
1280
+ "matches": "file-plain"
1281
+ },
1282
+ {
1283
+ "inside": {
1284
+ "stopBy": {
1285
+ "matches": "fn-like"
1286
+ },
1287
+ "matches": "opt-getter"
1288
+ }
1289
+ }
1290
+ ]
1291
+ },
1292
+ "transform": {
1293
+ "N1": {
1294
+ "replace": {
1295
+ "source": "$K",
1296
+ "replace": "^(?:\\[\\s*(?:'([^']*)'|\"([^\"]*)\")\\s*\\]|'([^']*)'|\"([^\"]*)\")$",
1297
+ "by": "${1}${2}${3}${4}"
1298
+ }
1299
+ },
1300
+ "NAME": {
1301
+ "replace": {
1302
+ "source": "$N1",
1303
+ "replace": "^\\[.*\\]$",
1304
+ "by": "Unknown"
1305
+ }
1306
+ }
1307
+ }
1308
+ }
1309
+ },
1310
+ "violation": {
1311
+ "anchor": "witness.span",
1312
+ "code": "vue/no-async-in-computed-properties",
1313
+ "message": "Remove this await from the \"$NAME\" computed and load the value in a watcher or method instead.",
1314
+ "suppress": {
1315
+ "eslint": {
1316
+ "rules": [
1317
+ "vue/no-async-in-computed-properties"
1318
+ ]
1319
+ }
1320
+ }
1321
+ }
1322
+ },
1323
+ {
1324
+ "id": "await-in-composition-getter",
1325
+ "forbid": {
1326
+ "ast": {
1327
+ "language": "vue",
1328
+ "embedded": "script-block",
1329
+ "rule": {
1330
+ "all": [
1331
+ {
1332
+ "kind": "await_expression"
1333
+ },
1334
+ {
1335
+ "matches": "comp-ctx"
1336
+ },
1337
+ {
1338
+ "inside": {
1339
+ "stopBy": {
1340
+ "matches": "fn-like"
1341
+ },
1342
+ "matches": "comp-getter"
1343
+ }
1344
+ }
1345
+ ]
1346
+ }
1347
+ }
1348
+ },
1349
+ "violation": {
1350
+ "anchor": "witness.span",
1351
+ "code": "vue/no-async-in-computed-properties",
1352
+ "message": "Remove this await from the computed getter and load the value in a watcher or function instead.",
1353
+ "suppress": {
1354
+ "eslint": {
1355
+ "rules": [
1356
+ "vue/no-async-in-computed-properties"
1357
+ ]
1358
+ }
1359
+ }
1360
+ }
1361
+ },
1362
+ {
1363
+ "id": "new-promise-in-options-getter",
1364
+ "forbid": {
1365
+ "ast": {
1366
+ "language": "vue",
1367
+ "embedded": "script-block",
1368
+ "rule": {
1369
+ "all": [
1370
+ {
1371
+ "kind": "new_expression",
1372
+ "has": {
1373
+ "field": "constructor",
1374
+ "kind": "identifier",
1375
+ "regex": "^Promise$"
1376
+ }
1377
+ },
1378
+ {
1379
+ "matches": "file-plain"
1380
+ },
1381
+ {
1382
+ "inside": {
1383
+ "stopBy": {
1384
+ "matches": "fn-like"
1385
+ },
1386
+ "matches": "opt-getter"
1387
+ }
1388
+ }
1389
+ ]
1390
+ },
1391
+ "transform": {
1392
+ "N1": {
1393
+ "replace": {
1394
+ "source": "$K",
1395
+ "replace": "^(?:\\[\\s*(?:'([^']*)'|\"([^\"]*)\")\\s*\\]|'([^']*)'|\"([^\"]*)\")$",
1396
+ "by": "${1}${2}${3}${4}"
1397
+ }
1398
+ },
1399
+ "NAME": {
1400
+ "replace": {
1401
+ "source": "$N1",
1402
+ "replace": "^\\[.*\\]$",
1403
+ "by": "Unknown"
1404
+ }
1405
+ }
1406
+ }
1407
+ }
1408
+ },
1409
+ "violation": {
1410
+ "anchor": "witness.span",
1411
+ "code": "vue/no-async-in-computed-properties",
1412
+ "message": "Remove this Promise from the \"$NAME\" computed and resolve the value in a watcher or method instead.",
1413
+ "suppress": {
1414
+ "eslint": {
1415
+ "rules": [
1416
+ "vue/no-async-in-computed-properties"
1417
+ ]
1418
+ }
1419
+ }
1420
+ }
1421
+ },
1422
+ {
1423
+ "id": "new-promise-in-composition-getter",
1424
+ "forbid": {
1425
+ "ast": {
1426
+ "language": "vue",
1427
+ "embedded": "script-block",
1428
+ "rule": {
1429
+ "all": [
1430
+ {
1431
+ "kind": "new_expression",
1432
+ "has": {
1433
+ "field": "constructor",
1434
+ "kind": "identifier",
1435
+ "regex": "^Promise$"
1436
+ }
1437
+ },
1438
+ {
1439
+ "matches": "comp-ctx"
1440
+ },
1441
+ {
1442
+ "inside": {
1443
+ "stopBy": {
1444
+ "matches": "fn-like"
1445
+ },
1446
+ "matches": "comp-getter"
1447
+ }
1448
+ }
1449
+ ]
1450
+ }
1451
+ }
1452
+ },
1453
+ "violation": {
1454
+ "anchor": "witness.span",
1455
+ "code": "vue/no-async-in-computed-properties",
1456
+ "message": "Remove this Promise from the computed getter and resolve the value in a watcher or function instead.",
1457
+ "suppress": {
1458
+ "eslint": {
1459
+ "rules": [
1460
+ "vue/no-async-in-computed-properties"
1461
+ ]
1462
+ }
1463
+ }
1464
+ }
1465
+ },
1466
+ {
1467
+ "id": "async-action-in-options-getter",
1468
+ "forbid": {
1469
+ "ast": {
1470
+ "language": "vue",
1471
+ "embedded": "script-block",
1472
+ "rule": {
1473
+ "all": [
1474
+ {
1475
+ "all": [
1476
+ {
1477
+ "kind": "call_expression"
1478
+ },
1479
+ {
1480
+ "has": {
1481
+ "field": "arguments",
1482
+ "kind": "arguments"
1483
+ }
1484
+ },
1485
+ {
1486
+ "any": [
1487
+ {
1488
+ "has": {
1489
+ "field": "function",
1490
+ "matches": "promise-callee"
1491
+ }
1492
+ },
1493
+ {
1494
+ "has": {
1495
+ "field": "function",
1496
+ "matches": "nexttick-callee"
1497
+ }
1498
+ }
1499
+ ]
1500
+ }
1501
+ ]
1502
+ },
1503
+ {
1504
+ "matches": "file-plain"
1505
+ },
1506
+ {
1507
+ "inside": {
1508
+ "stopBy": {
1509
+ "matches": "fn-like"
1510
+ },
1511
+ "matches": "opt-getter"
1512
+ }
1513
+ }
1514
+ ]
1515
+ },
1516
+ "transform": {
1517
+ "N1": {
1518
+ "replace": {
1519
+ "source": "$K",
1520
+ "replace": "^(?:\\[\\s*(?:'([^']*)'|\"([^\"]*)\")\\s*\\]|'([^']*)'|\"([^\"]*)\")$",
1521
+ "by": "${1}${2}${3}${4}"
1522
+ }
1523
+ },
1524
+ "NAME": {
1525
+ "replace": {
1526
+ "source": "$N1",
1527
+ "replace": "^\\[.*\\]$",
1528
+ "by": "Unknown"
1529
+ }
1530
+ }
1531
+ }
1532
+ }
1533
+ },
1534
+ "violation": {
1535
+ "anchor": "witness.span",
1536
+ "code": "vue/no-async-in-computed-properties",
1537
+ "message": "Move the async work out of the \"$NAME\" computed into a watcher or method, and have the computed return a value synchronously.",
1538
+ "suppress": {
1539
+ "eslint": {
1540
+ "rules": [
1541
+ "vue/no-async-in-computed-properties"
1542
+ ]
1543
+ }
1544
+ }
1545
+ }
1546
+ },
1547
+ {
1548
+ "id": "async-action-in-composition-getter",
1549
+ "forbid": {
1550
+ "ast": {
1551
+ "language": "vue",
1552
+ "embedded": "script-block",
1553
+ "rule": {
1554
+ "all": [
1555
+ {
1556
+ "all": [
1557
+ {
1558
+ "kind": "call_expression"
1559
+ },
1560
+ {
1561
+ "has": {
1562
+ "field": "arguments",
1563
+ "kind": "arguments"
1564
+ }
1565
+ },
1566
+ {
1567
+ "any": [
1568
+ {
1569
+ "has": {
1570
+ "field": "function",
1571
+ "matches": "promise-callee"
1572
+ }
1573
+ },
1574
+ {
1575
+ "has": {
1576
+ "field": "function",
1577
+ "matches": "nexttick-callee"
1578
+ }
1579
+ }
1580
+ ]
1581
+ }
1582
+ ]
1583
+ },
1584
+ {
1585
+ "matches": "comp-ctx"
1586
+ },
1587
+ {
1588
+ "inside": {
1589
+ "stopBy": {
1590
+ "matches": "fn-like"
1591
+ },
1592
+ "matches": "comp-getter"
1593
+ }
1594
+ }
1595
+ ]
1596
+ }
1597
+ }
1598
+ },
1599
+ "violation": {
1600
+ "anchor": "witness.span",
1601
+ "code": "vue/no-async-in-computed-properties",
1602
+ "message": "Move the async work out of this computed into a watcher or function, and have the getter return a value synchronously.",
1603
+ "suppress": {
1604
+ "eslint": {
1605
+ "rules": [
1606
+ "vue/no-async-in-computed-properties"
1607
+ ]
1608
+ }
1609
+ }
1610
+ }
1611
+ },
1612
+ {
1613
+ "id": "timed-function-in-options-getter",
1614
+ "forbid": {
1615
+ "ast": {
1616
+ "language": "vue",
1617
+ "embedded": "script-block",
1618
+ "rule": {
1619
+ "all": [
1620
+ {
1621
+ "all": [
1622
+ {
1623
+ "kind": "call_expression"
1624
+ },
1625
+ {
1626
+ "arguments": {
1627
+ "signature": [
1628
+ "callback"
1629
+ ],
1630
+ "bind": {
1631
+ "CB": "callback"
1632
+ },
1633
+ "mode": "estree"
1634
+ }
1635
+ },
1636
+ {
1637
+ "has": {
1638
+ "field": "function",
1639
+ "matches": "timed-callee"
1640
+ }
1641
+ }
1642
+ ]
1643
+ },
1644
+ {
1645
+ "matches": "file-plain"
1646
+ },
1647
+ {
1648
+ "inside": {
1649
+ "stopBy": {
1650
+ "matches": "fn-like"
1651
+ },
1652
+ "matches": "opt-getter"
1653
+ }
1654
+ }
1655
+ ]
1656
+ },
1657
+ "transform": {
1658
+ "N1": {
1659
+ "replace": {
1660
+ "source": "$K",
1661
+ "replace": "^(?:\\[\\s*(?:'([^']*)'|\"([^\"]*)\")\\s*\\]|'([^']*)'|\"([^\"]*)\")$",
1662
+ "by": "${1}${2}${3}${4}"
1663
+ }
1664
+ },
1665
+ "NAME": {
1666
+ "replace": {
1667
+ "source": "$N1",
1668
+ "replace": "^\\[.*\\]$",
1669
+ "by": "Unknown"
1670
+ }
1671
+ }
1672
+ }
1673
+ }
1674
+ },
1675
+ "violation": {
1676
+ "anchor": "witness.span",
1677
+ "code": "vue/no-async-in-computed-properties",
1678
+ "message": "Move this timer out of the \"$NAME\" computed into a watcher or method; the computed must return its value right away.",
1679
+ "suppress": {
1680
+ "eslint": {
1681
+ "rules": [
1682
+ "vue/no-async-in-computed-properties"
1683
+ ]
1684
+ }
1685
+ }
1686
+ }
1687
+ },
1688
+ {
1689
+ "id": "timed-function-in-composition-getter",
1690
+ "forbid": {
1691
+ "ast": {
1692
+ "language": "vue",
1693
+ "embedded": "script-block",
1694
+ "rule": {
1695
+ "all": [
1696
+ {
1697
+ "all": [
1698
+ {
1699
+ "kind": "call_expression"
1700
+ },
1701
+ {
1702
+ "arguments": {
1703
+ "signature": [
1704
+ "callback"
1705
+ ],
1706
+ "bind": {
1707
+ "CB": "callback"
1708
+ },
1709
+ "mode": "estree"
1710
+ }
1711
+ },
1712
+ {
1713
+ "has": {
1714
+ "field": "function",
1715
+ "matches": "timed-callee"
1716
+ }
1717
+ }
1718
+ ]
1719
+ },
1720
+ {
1721
+ "matches": "comp-ctx"
1722
+ },
1723
+ {
1724
+ "inside": {
1725
+ "stopBy": {
1726
+ "matches": "fn-like"
1727
+ },
1728
+ "matches": "comp-getter"
1729
+ }
1730
+ }
1731
+ ]
1732
+ }
1733
+ }
1734
+ },
1735
+ "violation": {
1736
+ "anchor": "witness.span",
1737
+ "code": "vue/no-async-in-computed-properties",
1738
+ "message": "Move this timer out of the computed getter into a watcher or function; the computed must return its value right away.",
1739
+ "suppress": {
1740
+ "eslint": {
1741
+ "rules": [
1742
+ "vue/no-async-in-computed-properties"
1743
+ ]
1744
+ }
1745
+ }
1746
+ }
1747
+ }
1748
+ ]
1749
+ }