@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,355 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "eslint-plugin-vue-no-use-v-if-with-v-for",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Don't put v-if on the same element as v-for; filter the list in a computed property or move the condition to a wrapper element.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*.vue"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "shared",
16
+ "define": {
17
+ "language": "vue",
18
+ "utils": {
19
+ "tag-node": {
20
+ "any": [
21
+ {
22
+ "kind": "start_tag"
23
+ },
24
+ {
25
+ "kind": "self_closing_tag"
26
+ }
27
+ ]
28
+ },
29
+ "el": {
30
+ "any": [
31
+ {
32
+ "kind": "element"
33
+ },
34
+ {
35
+ "kind": "template_element"
36
+ }
37
+ ]
38
+ },
39
+ "vfor": {
40
+ "kind": "directive_attribute",
41
+ "regex": "^v-for(?:[.:=\\s]|$)"
42
+ },
43
+ "binder": {
44
+ "any": [
45
+ {
46
+ "kind": "identifier"
47
+ },
48
+ {
49
+ "kind": "shorthand_property_identifier_pattern"
50
+ }
51
+ ]
52
+ },
53
+ "ref": {
54
+ "any": [
55
+ {
56
+ "kind": "identifier"
57
+ },
58
+ {
59
+ "kind": "shorthand_property_identifier"
60
+ }
61
+ ]
62
+ },
63
+ "uses": {
64
+ "embedded": {
65
+ "all": [
66
+ {
67
+ "matches": "ref"
68
+ },
69
+ {
70
+ "pattern": "$REF"
71
+ },
72
+ {
73
+ "inside": {
74
+ "stopBy": "end",
75
+ "kind": "parenthesized_expression",
76
+ "inside": {
77
+ "stopBy": "neighbor",
78
+ "field": "condition",
79
+ "kind": "if_statement",
80
+ "has": {
81
+ "stopBy": "neighbor",
82
+ "field": "consequence",
83
+ "kind": "statement_block",
84
+ "has": {
85
+ "stopBy": "neighbor",
86
+ "kind": "expression_statement",
87
+ "has": {
88
+ "stopBy": "neighbor",
89
+ "kind": "sequence_expression",
90
+ "has": {
91
+ "stopBy": "neighbor",
92
+ "kind": "arrow_function",
93
+ "has": {
94
+ "stopBy": "neighbor",
95
+ "kind": "formal_parameters",
96
+ "has": {
97
+ "stopBy": "end",
98
+ "all": [
99
+ {
100
+ "matches": "binder"
101
+ },
102
+ {
103
+ "pattern": "$AL"
104
+ },
105
+ {
106
+ "compare": {
107
+ "left": "REF",
108
+ "op": "eq",
109
+ "right": "AL",
110
+ "text": "source"
111
+ }
112
+ }
113
+ ]
114
+ }
115
+ }
116
+ }
117
+ }
118
+ }
119
+ }
120
+ }
121
+ }
122
+ }
123
+ ]
124
+ }
125
+ }
126
+ }
127
+ }
128
+ },
129
+ {
130
+ "id": "moved-to-wrapper",
131
+ "forbid": {
132
+ "ast": {
133
+ "language": "vue",
134
+ "rule": {
135
+ "all": [
136
+ {
137
+ "kind": "directive_attribute",
138
+ "regex": "^v-if(?:[.:=\\s]|$)"
139
+ },
140
+ {
141
+ "inside": {
142
+ "stopBy": "neighbor",
143
+ "all": [
144
+ {
145
+ "matches": "tag-node"
146
+ },
147
+ {
148
+ "has": {
149
+ "stopBy": "neighbor",
150
+ "matches": "vfor"
151
+ }
152
+ }
153
+ ],
154
+ "inside": {
155
+ "stopBy": "neighbor",
156
+ "matches": "el"
157
+ }
158
+ }
159
+ },
160
+ {
161
+ "inside": {
162
+ "stopBy": "end",
163
+ "kind": "template_element"
164
+ }
165
+ },
166
+ {
167
+ "not": {
168
+ "matches": "uses"
169
+ }
170
+ }
171
+ ]
172
+ }
173
+ }
174
+ },
175
+ "violation": {
176
+ "anchor": "witness.span",
177
+ "code": "vue/no-use-v-if-with-v-for",
178
+ "message": "This 'v-if' should be moved to the wrapper element.",
179
+ "suppress": {
180
+ "eslint": {
181
+ "rules": [
182
+ "vue/no-use-v-if-with-v-for"
183
+ ]
184
+ }
185
+ }
186
+ }
187
+ },
188
+ {
189
+ "id": "computed-variable",
190
+ "forbid": {
191
+ "ast": {
192
+ "language": "vue",
193
+ "rule": {
194
+ "all": [
195
+ {
196
+ "kind": "directive_attribute",
197
+ "regex": "^v-if(?:[.:=\\s]|$)"
198
+ },
199
+ {
200
+ "inside": {
201
+ "stopBy": "neighbor",
202
+ "all": [
203
+ {
204
+ "matches": "tag-node"
205
+ },
206
+ {
207
+ "has": {
208
+ "stopBy": "neighbor",
209
+ "matches": "vfor",
210
+ "embedded": {
211
+ "all": [
212
+ {
213
+ "pattern": "$SRC"
214
+ },
215
+ {
216
+ "kind": "identifier"
217
+ },
218
+ {
219
+ "not": {
220
+ "kind": "comment"
221
+ }
222
+ },
223
+ {
224
+ "inside": {
225
+ "stopBy": "neighbor",
226
+ "kind": "parenthesized_expression",
227
+ "inside": {
228
+ "stopBy": "neighbor",
229
+ "kind": "sequence_expression"
230
+ }
231
+ }
232
+ }
233
+ ]
234
+ }
235
+ }
236
+ }
237
+ ],
238
+ "inside": {
239
+ "stopBy": "neighbor",
240
+ "matches": "el"
241
+ }
242
+ }
243
+ },
244
+ {
245
+ "inside": {
246
+ "stopBy": "end",
247
+ "kind": "template_element"
248
+ }
249
+ },
250
+ {
251
+ "matches": "uses"
252
+ }
253
+ ]
254
+ }
255
+ }
256
+ },
257
+ "violation": {
258
+ "anchor": "witness.span",
259
+ "code": "vue/no-use-v-if-with-v-for",
260
+ "message": "Replace '$SRC' in this v-for with a computed property that returns the filtered list, and drop the v-if.",
261
+ "suppress": {
262
+ "eslint": {
263
+ "rules": [
264
+ "vue/no-use-v-if-with-v-for"
265
+ ]
266
+ }
267
+ }
268
+ }
269
+ },
270
+ {
271
+ "id": "computed-expression",
272
+ "forbid": {
273
+ "ast": {
274
+ "language": "vue",
275
+ "rule": {
276
+ "all": [
277
+ {
278
+ "kind": "directive_attribute",
279
+ "regex": "^v-if(?:[.:=\\s]|$)"
280
+ },
281
+ {
282
+ "inside": {
283
+ "stopBy": "neighbor",
284
+ "all": [
285
+ {
286
+ "matches": "tag-node"
287
+ },
288
+ {
289
+ "has": {
290
+ "stopBy": "neighbor",
291
+ "matches": "vfor",
292
+ "embedded": {
293
+ "all": [
294
+ {
295
+ "pattern": "$SRC"
296
+ },
297
+ {
298
+ "not": {
299
+ "kind": "identifier"
300
+ }
301
+ },
302
+ {
303
+ "not": {
304
+ "kind": "comment"
305
+ }
306
+ },
307
+ {
308
+ "inside": {
309
+ "stopBy": "neighbor",
310
+ "kind": "parenthesized_expression",
311
+ "inside": {
312
+ "stopBy": "neighbor",
313
+ "kind": "sequence_expression"
314
+ }
315
+ }
316
+ }
317
+ ]
318
+ }
319
+ }
320
+ }
321
+ ],
322
+ "inside": {
323
+ "stopBy": "neighbor",
324
+ "matches": "el"
325
+ }
326
+ }
327
+ },
328
+ {
329
+ "inside": {
330
+ "stopBy": "end",
331
+ "kind": "template_element"
332
+ }
333
+ },
334
+ {
335
+ "matches": "uses"
336
+ }
337
+ ]
338
+ }
339
+ }
340
+ },
341
+ "violation": {
342
+ "anchor": "witness.span",
343
+ "code": "vue/no-use-v-if-with-v-for",
344
+ "message": "Replace the '$SRC' expression in this v-for with a computed property that returns the filtered list, and drop the v-if.",
345
+ "suppress": {
346
+ "eslint": {
347
+ "rules": [
348
+ "vue/no-use-v-if-with-v-for"
349
+ ]
350
+ }
351
+ }
352
+ }
353
+ }
354
+ ]
355
+ }
@@ -0,0 +1,43 @@
1
+ {
2
+ "format": "rerail.policy/v1",
3
+ "id": "eslint-plugin-vue-no-v-html",
4
+ "revision": 1,
5
+ "mode": "steer",
6
+ "description": "Avoid the v-html directive; rendering raw HTML can expose users to XSS attacks.",
7
+ "scope": {
8
+ "include": [
9
+ "**/*.vue"
10
+ ],
11
+ "exclude": []
12
+ },
13
+ "clauses": [
14
+ {
15
+ "id": "upstream",
16
+ "forbid": {
17
+ "ast": {
18
+ "language": "vue",
19
+ "rule": {
20
+ "kind": "directive_attribute",
21
+ "has": {
22
+ "stopBy": "neighbor",
23
+ "kind": "directive_name",
24
+ "regex": "^v-html$"
25
+ }
26
+ }
27
+ }
28
+ },
29
+ "violation": {
30
+ "anchor": "witness.span",
31
+ "code": "vue/no-v-html",
32
+ "message": "Render this content with text interpolation or components instead of v-html, or sanitize it first, to avoid XSS.",
33
+ "suppress": {
34
+ "eslint": {
35
+ "rules": [
36
+ "vue/no-v-html"
37
+ ]
38
+ }
39
+ }
40
+ }
41
+ }
42
+ ]
43
+ }