@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,545 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "eslint-plugin-vue-no-unused-vars",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Remove v-for aliases and slot parameters that the Vue template never uses.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*.vue"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "upstream",
16
+ "forbid": {
17
+ "ast": {
18
+ "language": "vue",
19
+ "embedded": "script-block",
20
+ "utils": {
21
+ "view-arrow": {
22
+ "kind": "arrow_function",
23
+ "any": [
24
+ {
25
+ "inside": {
26
+ "kind": "expression_statement"
27
+ }
28
+ },
29
+ {
30
+ "inside": {
31
+ "kind": "sequence_expression",
32
+ "inside": {
33
+ "kind": "expression_statement"
34
+ }
35
+ }
36
+ }
37
+ ],
38
+ "inside": {
39
+ "stopBy": "end",
40
+ "kind": "statement_block",
41
+ "host": {
42
+ "kind": "template_element"
43
+ }
44
+ }
45
+ },
46
+ "view-param": {
47
+ "all": [
48
+ {
49
+ "any": [
50
+ {
51
+ "kind": "identifier"
52
+ },
53
+ {
54
+ "kind": "shorthand_property_identifier_pattern"
55
+ }
56
+ ]
57
+ },
58
+ {
59
+ "binds": {
60
+ "form": "parameter"
61
+ }
62
+ },
63
+ {
64
+ "inside": {
65
+ "stopBy": "end",
66
+ "kind": "formal_parameters",
67
+ "inside": {
68
+ "matches": "view-arrow"
69
+ }
70
+ }
71
+ }
72
+ ]
73
+ },
74
+ "param-destructured": {
75
+ "any": [
76
+ {
77
+ "kind": "shorthand_property_identifier_pattern"
78
+ },
79
+ {
80
+ "inside": {
81
+ "stopBy": "end",
82
+ "any": [
83
+ {
84
+ "kind": "pair_pattern"
85
+ },
86
+ {
87
+ "kind": "array_pattern"
88
+ }
89
+ ]
90
+ }
91
+ }
92
+ ]
93
+ },
94
+ "cond-used-q": {
95
+ "inside": {
96
+ "stopBy": "end",
97
+ "kind": "formal_parameters",
98
+ "inside": {
99
+ "kind": "arrow_function",
100
+ "inside": {
101
+ "kind": "sequence_expression",
102
+ "inside": {
103
+ "kind": "expression_statement",
104
+ "host": {
105
+ "any": [
106
+ {
107
+ "has": {
108
+ "stopBy": "neighbor",
109
+ "kind": "directive_attribute",
110
+ "regex": "^v-(?:else-)?if(?:[.:=\\s]|$)"
111
+ }
112
+ },
113
+ {
114
+ "has": {
115
+ "stopBy": "neighbor",
116
+ "any": [
117
+ {
118
+ "kind": "start_tag"
119
+ },
120
+ {
121
+ "kind": "self_closing_tag"
122
+ }
123
+ ],
124
+ "has": {
125
+ "stopBy": "neighbor",
126
+ "kind": "directive_attribute",
127
+ "regex": "^v-(?:else-)?if(?:[.:=\\s]|$)"
128
+ }
129
+ }
130
+ }
131
+ ]
132
+ },
133
+ "inside": {
134
+ "stopBy": "neighbor",
135
+ "kind": "statement_block",
136
+ "inside": {
137
+ "stopBy": "neighbor",
138
+ "kind": "if_statement",
139
+ "has": {
140
+ "field": "condition",
141
+ "has": {
142
+ "stopBy": "end",
143
+ "any": [
144
+ {
145
+ "kind": "identifier"
146
+ },
147
+ {
148
+ "kind": "shorthand_property_identifier"
149
+ }
150
+ ],
151
+ "pattern": "$QR",
152
+ "compare": {
153
+ "left": "Q",
154
+ "op": "eq",
155
+ "right": "QR"
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
161
+ }
162
+ }
163
+ }
164
+ }
165
+ },
166
+ "cond-used-name": {
167
+ "inside": {
168
+ "stopBy": "end",
169
+ "kind": "formal_parameters",
170
+ "inside": {
171
+ "kind": "arrow_function",
172
+ "inside": {
173
+ "kind": "sequence_expression",
174
+ "inside": {
175
+ "kind": "expression_statement",
176
+ "host": {
177
+ "any": [
178
+ {
179
+ "has": {
180
+ "stopBy": "neighbor",
181
+ "kind": "directive_attribute",
182
+ "regex": "^v-(?:else-)?if(?:[.:=\\s]|$)"
183
+ }
184
+ },
185
+ {
186
+ "has": {
187
+ "stopBy": "neighbor",
188
+ "any": [
189
+ {
190
+ "kind": "start_tag"
191
+ },
192
+ {
193
+ "kind": "self_closing_tag"
194
+ }
195
+ ],
196
+ "has": {
197
+ "stopBy": "neighbor",
198
+ "kind": "directive_attribute",
199
+ "regex": "^v-(?:else-)?if(?:[.:=\\s]|$)"
200
+ }
201
+ }
202
+ }
203
+ ]
204
+ },
205
+ "inside": {
206
+ "stopBy": "neighbor",
207
+ "kind": "statement_block",
208
+ "inside": {
209
+ "stopBy": "neighbor",
210
+ "kind": "if_statement",
211
+ "has": {
212
+ "field": "condition",
213
+ "has": {
214
+ "stopBy": "end",
215
+ "any": [
216
+ {
217
+ "kind": "identifier"
218
+ },
219
+ {
220
+ "kind": "shorthand_property_identifier"
221
+ }
222
+ ],
223
+ "pattern": "$NAMER",
224
+ "compare": {
225
+ "left": "NAME",
226
+ "op": "eq",
227
+ "right": "NAMER"
228
+ }
229
+ }
230
+ }
231
+ }
232
+ }
233
+ }
234
+ }
235
+ }
236
+ }
237
+ },
238
+ "param-used": {
239
+ "pattern": "$Q",
240
+ "all": [
241
+ {
242
+ "any": [
243
+ {
244
+ "kind": "identifier"
245
+ },
246
+ {
247
+ "kind": "shorthand_property_identifier_pattern"
248
+ }
249
+ ]
250
+ },
251
+ {
252
+ "binds": {
253
+ "form": "parameter"
254
+ }
255
+ },
256
+ {
257
+ "any": [
258
+ {
259
+ "binds": {
260
+ "occurrence": {
261
+ "matches": "real-ref"
262
+ }
263
+ }
264
+ },
265
+ {
266
+ "matches": "cond-used-q"
267
+ }
268
+ ]
269
+ }
270
+ ]
271
+ },
272
+ "after-used": {
273
+ "any": [
274
+ {
275
+ "precedes": {
276
+ "stopBy": "end",
277
+ "any": [
278
+ {
279
+ "matches": "param-used"
280
+ },
281
+ {
282
+ "has": {
283
+ "stopBy": "end",
284
+ "matches": "param-used"
285
+ }
286
+ }
287
+ ]
288
+ }
289
+ },
290
+ {
291
+ "inside": {
292
+ "stopBy": {
293
+ "kind": "formal_parameters"
294
+ },
295
+ "not": {
296
+ "kind": "formal_parameters"
297
+ },
298
+ "precedes": {
299
+ "stopBy": "end",
300
+ "any": [
301
+ {
302
+ "matches": "param-used"
303
+ },
304
+ {
305
+ "has": {
306
+ "stopBy": "end",
307
+ "matches": "param-used"
308
+ }
309
+ }
310
+ ]
311
+ }
312
+ }
313
+ }
314
+ ]
315
+ },
316
+ "tag-read": {
317
+ "any": [
318
+ {
319
+ "inside": {
320
+ "stopBy": "neighbor",
321
+ "kind": "expression_statement"
322
+ }
323
+ },
324
+ {
325
+ "inside": {
326
+ "stopBy": {
327
+ "not": {
328
+ "kind": "member_expression"
329
+ }
330
+ },
331
+ "kind": "expression_statement"
332
+ }
333
+ }
334
+ ]
335
+ },
336
+ "real-ref": {
337
+ "all": [
338
+ {
339
+ "any": [
340
+ {
341
+ "kind": "identifier"
342
+ },
343
+ {
344
+ "kind": "shorthand_property_identifier"
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "not": {
350
+ "binds": {
351
+ "form": "parameter"
352
+ }
353
+ }
354
+ },
355
+ {
356
+ "not": {
357
+ "matches": "tag-read"
358
+ }
359
+ },
360
+ {
361
+ "not": {
362
+ "matches": "filter-callee"
363
+ }
364
+ }
365
+ ]
366
+ },
367
+ "filter-pipe": {
368
+ "pattern": "$_ | $_",
369
+ "inside": {
370
+ "stopBy": {
371
+ "not": {
372
+ "pattern": "$_ | $_"
373
+ }
374
+ },
375
+ "kind": "parenthesized_expression",
376
+ "host": {
377
+ "any": [
378
+ {
379
+ "kind": "interpolation"
380
+ },
381
+ {
382
+ "kind": "directive_attribute",
383
+ "regex": "^(?:v-bind(?:[:.=\\s]|$)|[:.])"
384
+ }
385
+ ]
386
+ },
387
+ "inside": {
388
+ "stopBy": "neighbor",
389
+ "kind": "expression_statement"
390
+ }
391
+ }
392
+ },
393
+ "filter-callee": {
394
+ "kind": "identifier",
395
+ "any": [
396
+ {
397
+ "inside": {
398
+ "stopBy": "neighbor",
399
+ "field": "right",
400
+ "matches": "filter-pipe"
401
+ }
402
+ },
403
+ {
404
+ "inside": {
405
+ "stopBy": "neighbor",
406
+ "field": "function",
407
+ "kind": "call_expression",
408
+ "inside": {
409
+ "stopBy": "neighbor",
410
+ "field": "right",
411
+ "matches": "filter-pipe"
412
+ }
413
+ }
414
+ }
415
+ ]
416
+ },
417
+ "tag-used-host": {
418
+ "host": {
419
+ "inside": {
420
+ "stopBy": "end",
421
+ "kind": "directive_attribute",
422
+ "inside": {
423
+ "stopBy": "neighbor",
424
+ "any": [
425
+ {
426
+ "kind": "start_tag"
427
+ },
428
+ {
429
+ "kind": "self_closing_tag"
430
+ }
431
+ ],
432
+ "inside": {
433
+ "stopBy": "neighbor",
434
+ "any": [
435
+ {
436
+ "kind": "element"
437
+ },
438
+ {
439
+ "kind": "template_element"
440
+ }
441
+ ],
442
+ "has": {
443
+ "stopBy": "end",
444
+ "any": [
445
+ {
446
+ "kind": "element"
447
+ },
448
+ {
449
+ "kind": "template_element"
450
+ }
451
+ ],
452
+ "has": {
453
+ "stopBy": "neighbor",
454
+ "any": [
455
+ {
456
+ "kind": "start_tag"
457
+ },
458
+ {
459
+ "kind": "self_closing_tag"
460
+ }
461
+ ],
462
+ "has": {
463
+ "stopBy": "neighbor",
464
+ "kind": "tag_name",
465
+ "pattern": "$TN",
466
+ "compare": {
467
+ "left": "NAME",
468
+ "op": "eq",
469
+ "right": "TN"
470
+ }
471
+ },
472
+ "not": {
473
+ "regex": "^<[^\\s/>.]+\\."
474
+ }
475
+ }
476
+ }
477
+ }
478
+ }
479
+ }
480
+ }
481
+ }
482
+ },
483
+ "rule": {
484
+ "pattern": "$NAME",
485
+ "all": [
486
+ {
487
+ "matches": "view-param"
488
+ },
489
+ {
490
+ "binds": {
491
+ "form": "parameter"
492
+ }
493
+ },
494
+ {
495
+ "not": {
496
+ "binds": {
497
+ "occurrence": {
498
+ "matches": "real-ref"
499
+ }
500
+ }
501
+ }
502
+ },
503
+ {
504
+ "not": {
505
+ "matches": "cond-used-name"
506
+ }
507
+ },
508
+ {
509
+ "not": {
510
+ "matches": "tag-used-host"
511
+ }
512
+ },
513
+ {
514
+ "not": {
515
+ "all": [
516
+ {
517
+ "not": {
518
+ "matches": "param-destructured"
519
+ }
520
+ },
521
+ {
522
+ "matches": "after-used"
523
+ }
524
+ ]
525
+ }
526
+ }
527
+ ]
528
+ }
529
+ }
530
+ },
531
+ "violation": {
532
+ "anchor": "witness.span",
533
+ "code": "vue/no-unused-vars",
534
+ "message": "'$NAME' is defined but never used.",
535
+ "suppress": {
536
+ "eslint": {
537
+ "rules": [
538
+ "vue/no-unused-vars"
539
+ ]
540
+ }
541
+ }
542
+ }
543
+ }
544
+ ]
545
+ }