@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,456 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "eslint-plugin-vue-no-v-text-v-html-on-component",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Don't use v-text or v-html on a Vue component; they replace the content the component renders.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*.vue"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "upstream",
16
+ "forbid": {
17
+ "ast": {
18
+ "language": "vue",
19
+ "utils": {
20
+ "tag-svg-ctx": {
21
+ "inside": {
22
+ "stopBy": "neighbor",
23
+ "any": [
24
+ {
25
+ "kind": "element"
26
+ },
27
+ {
28
+ "kind": "template_element"
29
+ }
30
+ ],
31
+ "inside": {
32
+ "stopBy": "neighbor",
33
+ "any": [
34
+ {
35
+ "kind": "element"
36
+ },
37
+ {
38
+ "kind": "template_element"
39
+ }
40
+ ],
41
+ "has": {
42
+ "stopBy": "neighbor",
43
+ "kind": "start_tag",
44
+ "matches": "svg-children"
45
+ }
46
+ }
47
+ }
48
+ },
49
+ "tag-math-ctx": {
50
+ "inside": {
51
+ "stopBy": "neighbor",
52
+ "any": [
53
+ {
54
+ "kind": "element"
55
+ },
56
+ {
57
+ "kind": "template_element"
58
+ }
59
+ ],
60
+ "inside": {
61
+ "stopBy": "neighbor",
62
+ "any": [
63
+ {
64
+ "kind": "element"
65
+ },
66
+ {
67
+ "kind": "template_element"
68
+ }
69
+ ],
70
+ "has": {
71
+ "stopBy": "neighbor",
72
+ "kind": "start_tag",
73
+ "matches": "math-children"
74
+ }
75
+ }
76
+ }
77
+ },
78
+ "parent-annotation-xml": {
79
+ "inside": {
80
+ "stopBy": "neighbor",
81
+ "any": [
82
+ {
83
+ "kind": "element"
84
+ },
85
+ {
86
+ "kind": "template_element"
87
+ }
88
+ ],
89
+ "inside": {
90
+ "stopBy": "neighbor",
91
+ "any": [
92
+ {
93
+ "kind": "element"
94
+ },
95
+ {
96
+ "kind": "template_element"
97
+ }
98
+ ],
99
+ "has": {
100
+ "stopBy": "neighbor",
101
+ "kind": "start_tag",
102
+ "has": {
103
+ "stopBy": "neighbor",
104
+ "kind": "tag_name",
105
+ "regex": "^annotation-xml$"
106
+ }
107
+ }
108
+ }
109
+ }
110
+ },
111
+ "parent-text-integration": {
112
+ "inside": {
113
+ "stopBy": "neighbor",
114
+ "any": [
115
+ {
116
+ "kind": "element"
117
+ },
118
+ {
119
+ "kind": "template_element"
120
+ }
121
+ ],
122
+ "inside": {
123
+ "stopBy": "neighbor",
124
+ "any": [
125
+ {
126
+ "kind": "element"
127
+ },
128
+ {
129
+ "kind": "template_element"
130
+ }
131
+ ],
132
+ "has": {
133
+ "stopBy": "neighbor",
134
+ "kind": "start_tag",
135
+ "has": {
136
+ "stopBy": "neighbor",
137
+ "kind": "tag_name",
138
+ "regex": "^(?:mi|mo|mn|ms|mtext)$"
139
+ }
140
+ }
141
+ }
142
+ }
143
+ },
144
+ "parent-math-ns": {
145
+ "inside": {
146
+ "stopBy": "neighbor",
147
+ "any": [
148
+ {
149
+ "kind": "element"
150
+ },
151
+ {
152
+ "kind": "template_element"
153
+ }
154
+ ],
155
+ "inside": {
156
+ "stopBy": "neighbor",
157
+ "any": [
158
+ {
159
+ "kind": "element"
160
+ },
161
+ {
162
+ "kind": "template_element"
163
+ }
164
+ ],
165
+ "has": {
166
+ "stopBy": "neighbor",
167
+ "kind": "start_tag",
168
+ "matches": "ns-math"
169
+ }
170
+ }
171
+ }
172
+ },
173
+ "svg-children": {
174
+ "all": [
175
+ {
176
+ "matches": "ns-svg"
177
+ },
178
+ {
179
+ "not": {
180
+ "has": {
181
+ "stopBy": "neighbor",
182
+ "kind": "tag_name",
183
+ "regex": "^(?:foreignObject|desc|title)$"
184
+ }
185
+ }
186
+ }
187
+ ]
188
+ },
189
+ "math-children": {
190
+ "all": [
191
+ {
192
+ "matches": "ns-math"
193
+ },
194
+ {
195
+ "not": {
196
+ "has": {
197
+ "stopBy": "neighbor",
198
+ "kind": "tag_name",
199
+ "regex": "^(?:mi|mo|mn|ms|mtext)$"
200
+ }
201
+ }
202
+ },
203
+ {
204
+ "not": {
205
+ "matches": "annotation-html"
206
+ }
207
+ }
208
+ ]
209
+ },
210
+ "annotation-html": {
211
+ "all": [
212
+ {
213
+ "has": {
214
+ "stopBy": "neighbor",
215
+ "kind": "tag_name",
216
+ "regex": "^annotation-xml$"
217
+ }
218
+ },
219
+ {
220
+ "has": {
221
+ "stopBy": "neighbor",
222
+ "kind": "attribute",
223
+ "all": [
224
+ {
225
+ "has": {
226
+ "stopBy": "neighbor",
227
+ "kind": "attribute_name",
228
+ "regex": "(?i)^encoding$"
229
+ }
230
+ },
231
+ {
232
+ "has": {
233
+ "stopBy": "end",
234
+ "kind": "attribute_value",
235
+ "regex": "^(?:text/html|application/xhtml\\+xml)$"
236
+ }
237
+ }
238
+ ]
239
+ }
240
+ }
241
+ ]
242
+ },
243
+ "ns-svg": {
244
+ "any": [
245
+ {
246
+ "matches": "tag-svg-ctx"
247
+ },
248
+ {
249
+ "all": [
250
+ {
251
+ "has": {
252
+ "stopBy": "neighbor",
253
+ "kind": "tag_name",
254
+ "regex": "^svg$"
255
+ }
256
+ },
257
+ {
258
+ "any": [
259
+ {
260
+ "not": {
261
+ "matches": "tag-math-ctx"
262
+ }
263
+ },
264
+ {
265
+ "matches": "parent-annotation-xml"
266
+ }
267
+ ]
268
+ }
269
+ ]
270
+ }
271
+ ]
272
+ },
273
+ "ns-math": {
274
+ "any": [
275
+ {
276
+ "matches": "tag-math-ctx"
277
+ },
278
+ {
279
+ "all": [
280
+ {
281
+ "has": {
282
+ "stopBy": "neighbor",
283
+ "kind": "tag_name",
284
+ "regex": "^math$"
285
+ }
286
+ },
287
+ {
288
+ "not": {
289
+ "matches": "tag-svg-ctx"
290
+ }
291
+ },
292
+ {
293
+ "not": {
294
+ "matches": "tag-math-ctx"
295
+ }
296
+ }
297
+ ]
298
+ },
299
+ {
300
+ "all": [
301
+ {
302
+ "has": {
303
+ "stopBy": "neighbor",
304
+ "kind": "tag_name",
305
+ "regex": "^(?:mglyph|malignmark)$"
306
+ }
307
+ },
308
+ {
309
+ "matches": "parent-text-integration"
310
+ },
311
+ {
312
+ "matches": "parent-math-ns"
313
+ }
314
+ ]
315
+ }
316
+ ]
317
+ },
318
+ "custom-tag": {
319
+ "any": [
320
+ {
321
+ "has": {
322
+ "stopBy": "neighbor",
323
+ "any": [
324
+ {
325
+ "kind": "attribute",
326
+ "has": {
327
+ "stopBy": "neighbor",
328
+ "kind": "attribute_name",
329
+ "regex": "(?i)^is$"
330
+ }
331
+ },
332
+ {
333
+ "kind": "directive_attribute",
334
+ "regex": "(?i)^(?:(?:v-bind:|[:.])is(?:[.=\\s]|$)|v-is(?:[:.=\\s]|$))"
335
+ }
336
+ ]
337
+ }
338
+ },
339
+ {
340
+ "regex": "^<[^\\s/>.]+\\."
341
+ },
342
+ {
343
+ "all": [
344
+ {
345
+ "not": {
346
+ "matches": "ns-svg"
347
+ }
348
+ },
349
+ {
350
+ "not": {
351
+ "matches": "ns-math"
352
+ }
353
+ },
354
+ {
355
+ "has": {
356
+ "stopBy": "neighbor",
357
+ "kind": "tag_name",
358
+ "not": {
359
+ "regex": "^(?:a|abbr|address|area|article|aside|audio|b|base|bdi|bdo|blockquote|body|br|button|camera|canvas|caption|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|geolocation|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|install|kbd|label|legend|li|link|main|map|mark|menu|meta|meter|microphone|model|nav|noscript|object|ol|optgroup|option|output|p|picture|pre|progress|q|rp|rt|ruby|s|samp|script|search|section|select|selectedcontent|slot|small|source|span|strong|style|sub|summary|sup|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr|track|u|ul|usermedia|var|video|wbr)$"
360
+ }
361
+ }
362
+ }
363
+ ]
364
+ },
365
+ {
366
+ "all": [
367
+ {
368
+ "matches": "ns-svg"
369
+ },
370
+ {
371
+ "has": {
372
+ "stopBy": "neighbor",
373
+ "kind": "tag_name",
374
+ "not": {
375
+ "regex": "^(?:a|animate|animateMotion|animateTransform|circle|clipPath|defs|desc|ellipse|feBlend|feColorMatrix|feComponentTransfer|feComposite|feConvolveMatrix|feDiffuseLighting|feDisplacementMap|feDistantLight|feDropShadow|feFlood|feFuncA|feFuncB|feFuncG|feFuncR|feGaussianBlur|feImage|feMerge|feMergeNode|feMorphology|feOffset|fePointLight|feSpecularLighting|feSpotLight|feTile|feTurbulence|filter|foreignObject|g|image|line|linearGradient|marker|mask|metadata|mpath|path|pattern|polygon|polyline|radialGradient|rect|script|set|stop|style|svg|switch|symbol|text|textPath|title|tspan|use|view)$"
376
+ }
377
+ }
378
+ }
379
+ ]
380
+ },
381
+ {
382
+ "all": [
383
+ {
384
+ "matches": "ns-math"
385
+ },
386
+ {
387
+ "not": {
388
+ "matches": "ns-svg"
389
+ }
390
+ },
391
+ {
392
+ "has": {
393
+ "stopBy": "neighbor",
394
+ "kind": "tag_name",
395
+ "not": {
396
+ "regex": "^(?:math|maction|annotation|annotation-xml|menclose|merror|mfenced|mfrac|mi|mmultiscripts|mn|mo|mover|mpadded|mphantom|mprescripts|mroot|mrow|ms|semantics|mspace|msqrt|mstyle|msub|msup|msubsup|mtable|mtd|mtext|mtr|munder|munderover)$"
397
+ }
398
+ }
399
+ }
400
+ ]
401
+ }
402
+ ]
403
+ },
404
+ "checked-tag": {
405
+ "any": [
406
+ {
407
+ "matches": "custom-tag"
408
+ },
409
+ {
410
+ "has": {
411
+ "stopBy": "neighbor",
412
+ "kind": "tag_name",
413
+ "regex": "^slot$"
414
+ }
415
+ }
416
+ ]
417
+ }
418
+ },
419
+ "rule": {
420
+ "kind": "directive_attribute",
421
+ "regex": "^v-(?<NAME>text|html)(?:[:.=\\s]|$)",
422
+ "inside": {
423
+ "stopBy": "neighbor",
424
+ "any": [
425
+ {
426
+ "kind": "start_tag",
427
+ "matches": "custom-tag"
428
+ },
429
+ {
430
+ "kind": "self_closing_tag",
431
+ "matches": "custom-tag"
432
+ }
433
+ ],
434
+ "inside": {
435
+ "stopBy": "end",
436
+ "kind": "template_element"
437
+ }
438
+ }
439
+ }
440
+ }
441
+ },
442
+ "violation": {
443
+ "anchor": "witness.span",
444
+ "code": "vue/no-v-text-v-html-on-component",
445
+ "message": "Remove v-${NAME} from this component and pass the content through a slot or prop instead.",
446
+ "suppress": {
447
+ "eslint": {
448
+ "rules": [
449
+ "vue/no-v-text-v-html-on-component"
450
+ ]
451
+ }
452
+ }
453
+ }
454
+ }
455
+ ]
456
+ }