@ngrok/mantle 0.89.0 → 0.90.1
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.
- package/dist/agent.json +1529 -1
- package/dist/alert-DO00UiQe.js +1 -0
- package/dist/{alert-CZYYlx9q.js → alert-ZaUBtgno.js} +1 -1
- package/dist/alert-center.js +1 -1
- package/dist/alert-dialog.js +1 -1
- package/dist/alert.js +1 -1
- package/dist/app-layout.d.ts +68 -13
- package/dist/app-layout.js +1 -1
- package/dist/card.d.ts +7 -0
- package/dist/combobox.d.ts +1 -1
- package/dist/command.js +1 -1
- package/dist/{dialog-BDzapPLR.js → dialog-CaGJD02w.js} +1 -1
- package/dist/dialog.js +1 -1
- package/dist/{dropdown-menu-CpRsyt_F.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +1 -1
- package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
- package/dist/dropdown-menu.d.ts +2 -2
- package/dist/empty.d.ts +7 -0
- package/dist/flag.d.ts +1 -1
- package/dist/flag.js +1 -1
- package/dist/hooks.d.ts +251 -1
- package/dist/hooks.js +1 -1
- package/dist/{icons-BMZnm4hM.js → icons-CAtjMNti.js} +1 -1
- package/dist/icons.js +1 -1
- package/dist/input.js +1 -1
- package/dist/llms.txt +117 -2
- package/dist/mantle.css +9 -0
- package/dist/migrations/0002-data-table-action-header.yml +526 -0
- package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
- package/dist/migrations/0004-priority-to-intent.yml +1728 -0
- package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
- package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
- package/dist/migrations/0008-tabs-separator.yml +1212 -0
- package/dist/migrations/0009-chart-root-mode.yml +871 -0
- package/dist/multi-select.d.ts +1 -1
- package/dist/multi-select.js +1 -1
- package/dist/pagination.d.ts +1 -1
- package/dist/{primitive-B-6XILB2.js → primitive-AGoxSJBI.js} +1 -1
- package/dist/sandbar.js +1 -1
- package/dist/{select-CxXb3aiC.d.ts → select-DlohFa54.d.ts} +1 -1
- package/dist/select.d.ts +1 -1
- package/dist/{separator-HzGvuD0B.d.ts → separator-BWGjCIl7.d.ts} +7 -0
- package/dist/separator.d.ts +1 -1
- package/dist/{sheet-DND_KjmS.js → sheet-H8zvhSuA.js} +1 -1
- package/dist/sheet.js +1 -1
- package/dist/sidebar.d.ts +17 -10
- package/dist/sidebar.js +1 -1
- package/dist/split-button.d.ts +1 -1
- package/dist/strata.d.ts +548 -0
- package/dist/strata.js +1 -0
- package/dist/tabs.d.ts +12 -2
- package/dist/tabs.js +1 -1
- package/dist/theme-6Q65C1Rx.js +1 -0
- package/dist/theme-switcher.d.ts +2 -2
- package/dist/theme-switcher.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/truncated-text.d.ts +9 -1
- package/dist/truncated-text.js +1 -1
- package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
- package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
- package/dist/well.d.ts +7 -0
- package/package.json +4 -3
- package/dist/alert-vfeV_hso.js +0 -1
- package/dist/dropdown-menu-CWUzGFgf.d.ts +0 -1
- package/dist/theme-BlCZHClJ.js +0 -1
- package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
|
@@ -0,0 +1,871 @@
|
|
|
1
|
+
# Every rule binds the local name of a chart Root's import from its
|
|
2
|
+
# `@ngrok/mantle/<chart>` subpath, so an aliased import matches and another
|
|
3
|
+
# library's `decorative` prop does not.
|
|
4
|
+
id: chart-decorative-flag
|
|
5
|
+
language: tsx
|
|
6
|
+
message: the chart Roots take mode="decorative" in place of the decorative flag
|
|
7
|
+
utils:
|
|
8
|
+
# A node that opens a lexical scope. The shadow search below stops at a
|
|
9
|
+
# nested one, so a sibling function's local name does not count.
|
|
10
|
+
scope:
|
|
11
|
+
any:
|
|
12
|
+
- kind: statement_block
|
|
13
|
+
- kind: function_declaration
|
|
14
|
+
- kind: generator_function_declaration
|
|
15
|
+
- kind: function_expression
|
|
16
|
+
- kind: generator_function
|
|
17
|
+
- kind: arrow_function
|
|
18
|
+
- kind: method_definition
|
|
19
|
+
- kind: class_body
|
|
20
|
+
- kind: for_statement
|
|
21
|
+
- kind: for_in_statement
|
|
22
|
+
- kind: catch_clause
|
|
23
|
+
# An identifier in a binding position: a parameter, a destructured name, a
|
|
24
|
+
# local variable, a function name, or a class name.
|
|
25
|
+
binding-name:
|
|
26
|
+
any:
|
|
27
|
+
- kind: shorthand_property_identifier_pattern
|
|
28
|
+
- kind: identifier
|
|
29
|
+
any:
|
|
30
|
+
- inside: { kind: variable_declarator, field: name }
|
|
31
|
+
- inside: { kind: function_declaration, field: name }
|
|
32
|
+
- inside: { kind: generator_function_declaration, field: name }
|
|
33
|
+
- inside: { kind: function_expression, field: name }
|
|
34
|
+
- inside: { kind: required_parameter, field: pattern }
|
|
35
|
+
- inside: { kind: optional_parameter, field: pattern }
|
|
36
|
+
- inside: { kind: assignment_pattern, field: left }
|
|
37
|
+
- inside: { kind: pair_pattern, field: value }
|
|
38
|
+
- inside: { kind: array_pattern }
|
|
39
|
+
- inside: { kind: rest_pattern }
|
|
40
|
+
- inside: { kind: arrow_function, field: parameter }
|
|
41
|
+
- inside: { kind: catch_clause, field: parameter }
|
|
42
|
+
- kind: type_identifier
|
|
43
|
+
inside: { kind: class_declaration, field: name }
|
|
44
|
+
# A function declaration opens a scope, so the search above stops at it and
|
|
45
|
+
# never reads its name. This matches the declaration itself instead.
|
|
46
|
+
function-declaration:
|
|
47
|
+
any:
|
|
48
|
+
- kind: function_declaration
|
|
49
|
+
- kind: generator_function_declaration
|
|
50
|
+
linechart-import:
|
|
51
|
+
kind: import_statement
|
|
52
|
+
all:
|
|
53
|
+
- has:
|
|
54
|
+
field: source
|
|
55
|
+
regex: ^["']@ngrok/mantle/line-chart["']$
|
|
56
|
+
- has:
|
|
57
|
+
stopBy: end
|
|
58
|
+
kind: import_specifier
|
|
59
|
+
has:
|
|
60
|
+
field: name
|
|
61
|
+
regex: ^LineChart$
|
|
62
|
+
any:
|
|
63
|
+
- kind: import_specifier
|
|
64
|
+
has:
|
|
65
|
+
field: alias
|
|
66
|
+
pattern: $LINE
|
|
67
|
+
- kind: import_specifier
|
|
68
|
+
not:
|
|
69
|
+
has:
|
|
70
|
+
field: alias
|
|
71
|
+
kind: identifier
|
|
72
|
+
has:
|
|
73
|
+
field: name
|
|
74
|
+
pattern: $LINE
|
|
75
|
+
barchart-import:
|
|
76
|
+
kind: import_statement
|
|
77
|
+
all:
|
|
78
|
+
- has:
|
|
79
|
+
field: source
|
|
80
|
+
regex: ^["']@ngrok/mantle/bar-chart["']$
|
|
81
|
+
- has:
|
|
82
|
+
stopBy: end
|
|
83
|
+
kind: import_specifier
|
|
84
|
+
has:
|
|
85
|
+
field: name
|
|
86
|
+
regex: ^BarChart$
|
|
87
|
+
any:
|
|
88
|
+
- kind: import_specifier
|
|
89
|
+
has:
|
|
90
|
+
field: alias
|
|
91
|
+
pattern: $BAR
|
|
92
|
+
- kind: import_specifier
|
|
93
|
+
not:
|
|
94
|
+
has:
|
|
95
|
+
field: alias
|
|
96
|
+
kind: identifier
|
|
97
|
+
has:
|
|
98
|
+
field: name
|
|
99
|
+
pattern: $BAR
|
|
100
|
+
areachart-import:
|
|
101
|
+
kind: import_statement
|
|
102
|
+
all:
|
|
103
|
+
- has:
|
|
104
|
+
field: source
|
|
105
|
+
regex: ^["']@ngrok/mantle/area-chart["']$
|
|
106
|
+
- has:
|
|
107
|
+
stopBy: end
|
|
108
|
+
kind: import_specifier
|
|
109
|
+
has:
|
|
110
|
+
field: name
|
|
111
|
+
regex: ^AreaChart$
|
|
112
|
+
any:
|
|
113
|
+
- kind: import_specifier
|
|
114
|
+
has:
|
|
115
|
+
field: alias
|
|
116
|
+
pattern: $AREA
|
|
117
|
+
- kind: import_specifier
|
|
118
|
+
not:
|
|
119
|
+
has:
|
|
120
|
+
field: alias
|
|
121
|
+
kind: identifier
|
|
122
|
+
has:
|
|
123
|
+
field: name
|
|
124
|
+
pattern: $AREA
|
|
125
|
+
scatterplot-import:
|
|
126
|
+
kind: import_statement
|
|
127
|
+
all:
|
|
128
|
+
- has:
|
|
129
|
+
field: source
|
|
130
|
+
regex: ^["']@ngrok/mantle/scatter-plot["']$
|
|
131
|
+
- has:
|
|
132
|
+
stopBy: end
|
|
133
|
+
kind: import_specifier
|
|
134
|
+
has:
|
|
135
|
+
field: name
|
|
136
|
+
regex: ^ScatterPlot$
|
|
137
|
+
any:
|
|
138
|
+
- kind: import_specifier
|
|
139
|
+
has:
|
|
140
|
+
field: alias
|
|
141
|
+
pattern: $SCATTER
|
|
142
|
+
- kind: import_specifier
|
|
143
|
+
not:
|
|
144
|
+
has:
|
|
145
|
+
field: alias
|
|
146
|
+
kind: identifier
|
|
147
|
+
has:
|
|
148
|
+
field: name
|
|
149
|
+
pattern: $SCATTER
|
|
150
|
+
chart-root:
|
|
151
|
+
any:
|
|
152
|
+
- kind: jsx_opening_element
|
|
153
|
+
- kind: jsx_self_closing_element
|
|
154
|
+
has:
|
|
155
|
+
field: name
|
|
156
|
+
kind: member_expression
|
|
157
|
+
any:
|
|
158
|
+
- all:
|
|
159
|
+
- has:
|
|
160
|
+
field: object
|
|
161
|
+
pattern: $LINE
|
|
162
|
+
- has:
|
|
163
|
+
field: property
|
|
164
|
+
regex: ^Root$
|
|
165
|
+
- inside:
|
|
166
|
+
stopBy: end
|
|
167
|
+
kind: program
|
|
168
|
+
has:
|
|
169
|
+
matches: linechart-import
|
|
170
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
171
|
+
# rules cannot tell which binding the element reads.
|
|
172
|
+
- not:
|
|
173
|
+
inside:
|
|
174
|
+
stopBy: end
|
|
175
|
+
matches: scope
|
|
176
|
+
has:
|
|
177
|
+
stopBy:
|
|
178
|
+
matches: scope
|
|
179
|
+
any:
|
|
180
|
+
- matches: binding-name
|
|
181
|
+
pattern: $LINE
|
|
182
|
+
- matches: function-declaration
|
|
183
|
+
has:
|
|
184
|
+
field: name
|
|
185
|
+
pattern: $LINE
|
|
186
|
+
- all:
|
|
187
|
+
- has:
|
|
188
|
+
field: object
|
|
189
|
+
pattern: $BAR
|
|
190
|
+
- has:
|
|
191
|
+
field: property
|
|
192
|
+
regex: ^Root$
|
|
193
|
+
- inside:
|
|
194
|
+
stopBy: end
|
|
195
|
+
kind: program
|
|
196
|
+
has:
|
|
197
|
+
matches: barchart-import
|
|
198
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
199
|
+
# rules cannot tell which binding the element reads.
|
|
200
|
+
- not:
|
|
201
|
+
inside:
|
|
202
|
+
stopBy: end
|
|
203
|
+
matches: scope
|
|
204
|
+
has:
|
|
205
|
+
stopBy:
|
|
206
|
+
matches: scope
|
|
207
|
+
any:
|
|
208
|
+
- matches: binding-name
|
|
209
|
+
pattern: $BAR
|
|
210
|
+
- matches: function-declaration
|
|
211
|
+
has:
|
|
212
|
+
field: name
|
|
213
|
+
pattern: $BAR
|
|
214
|
+
- all:
|
|
215
|
+
- has:
|
|
216
|
+
field: object
|
|
217
|
+
pattern: $AREA
|
|
218
|
+
- has:
|
|
219
|
+
field: property
|
|
220
|
+
regex: ^Root$
|
|
221
|
+
- inside:
|
|
222
|
+
stopBy: end
|
|
223
|
+
kind: program
|
|
224
|
+
has:
|
|
225
|
+
matches: areachart-import
|
|
226
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
227
|
+
# rules cannot tell which binding the element reads.
|
|
228
|
+
- not:
|
|
229
|
+
inside:
|
|
230
|
+
stopBy: end
|
|
231
|
+
matches: scope
|
|
232
|
+
has:
|
|
233
|
+
stopBy:
|
|
234
|
+
matches: scope
|
|
235
|
+
any:
|
|
236
|
+
- matches: binding-name
|
|
237
|
+
pattern: $AREA
|
|
238
|
+
- matches: function-declaration
|
|
239
|
+
has:
|
|
240
|
+
field: name
|
|
241
|
+
pattern: $AREA
|
|
242
|
+
- all:
|
|
243
|
+
- has:
|
|
244
|
+
field: object
|
|
245
|
+
pattern: $SCATTER
|
|
246
|
+
- has:
|
|
247
|
+
field: property
|
|
248
|
+
regex: ^Root$
|
|
249
|
+
- inside:
|
|
250
|
+
stopBy: end
|
|
251
|
+
kind: program
|
|
252
|
+
has:
|
|
253
|
+
matches: scatterplot-import
|
|
254
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
255
|
+
# rules cannot tell which binding the element reads.
|
|
256
|
+
- not:
|
|
257
|
+
inside:
|
|
258
|
+
stopBy: end
|
|
259
|
+
matches: scope
|
|
260
|
+
has:
|
|
261
|
+
stopBy:
|
|
262
|
+
matches: scope
|
|
263
|
+
any:
|
|
264
|
+
- matches: binding-name
|
|
265
|
+
pattern: $SCATTER
|
|
266
|
+
- matches: function-declaration
|
|
267
|
+
has:
|
|
268
|
+
field: name
|
|
269
|
+
pattern: $SCATTER
|
|
270
|
+
rule:
|
|
271
|
+
kind: jsx_attribute
|
|
272
|
+
has:
|
|
273
|
+
kind: property_identifier
|
|
274
|
+
regex: ^decorative$
|
|
275
|
+
any:
|
|
276
|
+
- kind: jsx_attribute
|
|
277
|
+
not:
|
|
278
|
+
has:
|
|
279
|
+
kind: jsx_expression
|
|
280
|
+
- kind: jsx_attribute
|
|
281
|
+
has:
|
|
282
|
+
kind: jsx_expression
|
|
283
|
+
has:
|
|
284
|
+
kind: "true"
|
|
285
|
+
inside:
|
|
286
|
+
matches: chart-root
|
|
287
|
+
fix: mode="decorative"
|
|
288
|
+
---
|
|
289
|
+
id: chart-decorative-expression
|
|
290
|
+
language: tsx
|
|
291
|
+
message: a dynamic decorative flag picks between the decorative and interactive modes
|
|
292
|
+
utils:
|
|
293
|
+
# A node that opens a lexical scope. The shadow search below stops at a
|
|
294
|
+
# nested one, so a sibling function's local name does not count.
|
|
295
|
+
scope:
|
|
296
|
+
any:
|
|
297
|
+
- kind: statement_block
|
|
298
|
+
- kind: function_declaration
|
|
299
|
+
- kind: generator_function_declaration
|
|
300
|
+
- kind: function_expression
|
|
301
|
+
- kind: generator_function
|
|
302
|
+
- kind: arrow_function
|
|
303
|
+
- kind: method_definition
|
|
304
|
+
- kind: class_body
|
|
305
|
+
- kind: for_statement
|
|
306
|
+
- kind: for_in_statement
|
|
307
|
+
- kind: catch_clause
|
|
308
|
+
# An identifier in a binding position: a parameter, a destructured name, a
|
|
309
|
+
# local variable, a function name, or a class name.
|
|
310
|
+
binding-name:
|
|
311
|
+
any:
|
|
312
|
+
- kind: shorthand_property_identifier_pattern
|
|
313
|
+
- kind: identifier
|
|
314
|
+
any:
|
|
315
|
+
- inside: { kind: variable_declarator, field: name }
|
|
316
|
+
- inside: { kind: function_declaration, field: name }
|
|
317
|
+
- inside: { kind: generator_function_declaration, field: name }
|
|
318
|
+
- inside: { kind: function_expression, field: name }
|
|
319
|
+
- inside: { kind: required_parameter, field: pattern }
|
|
320
|
+
- inside: { kind: optional_parameter, field: pattern }
|
|
321
|
+
- inside: { kind: assignment_pattern, field: left }
|
|
322
|
+
- inside: { kind: pair_pattern, field: value }
|
|
323
|
+
- inside: { kind: array_pattern }
|
|
324
|
+
- inside: { kind: rest_pattern }
|
|
325
|
+
- inside: { kind: arrow_function, field: parameter }
|
|
326
|
+
- inside: { kind: catch_clause, field: parameter }
|
|
327
|
+
- kind: type_identifier
|
|
328
|
+
inside: { kind: class_declaration, field: name }
|
|
329
|
+
# A function declaration opens a scope, so the search above stops at it and
|
|
330
|
+
# never reads its name. This matches the declaration itself instead.
|
|
331
|
+
function-declaration:
|
|
332
|
+
any:
|
|
333
|
+
- kind: function_declaration
|
|
334
|
+
- kind: generator_function_declaration
|
|
335
|
+
linechart-import:
|
|
336
|
+
kind: import_statement
|
|
337
|
+
all:
|
|
338
|
+
- has:
|
|
339
|
+
field: source
|
|
340
|
+
regex: ^["']@ngrok/mantle/line-chart["']$
|
|
341
|
+
- has:
|
|
342
|
+
stopBy: end
|
|
343
|
+
kind: import_specifier
|
|
344
|
+
has:
|
|
345
|
+
field: name
|
|
346
|
+
regex: ^LineChart$
|
|
347
|
+
any:
|
|
348
|
+
- kind: import_specifier
|
|
349
|
+
has:
|
|
350
|
+
field: alias
|
|
351
|
+
pattern: $LINE
|
|
352
|
+
- kind: import_specifier
|
|
353
|
+
not:
|
|
354
|
+
has:
|
|
355
|
+
field: alias
|
|
356
|
+
kind: identifier
|
|
357
|
+
has:
|
|
358
|
+
field: name
|
|
359
|
+
pattern: $LINE
|
|
360
|
+
barchart-import:
|
|
361
|
+
kind: import_statement
|
|
362
|
+
all:
|
|
363
|
+
- has:
|
|
364
|
+
field: source
|
|
365
|
+
regex: ^["']@ngrok/mantle/bar-chart["']$
|
|
366
|
+
- has:
|
|
367
|
+
stopBy: end
|
|
368
|
+
kind: import_specifier
|
|
369
|
+
has:
|
|
370
|
+
field: name
|
|
371
|
+
regex: ^BarChart$
|
|
372
|
+
any:
|
|
373
|
+
- kind: import_specifier
|
|
374
|
+
has:
|
|
375
|
+
field: alias
|
|
376
|
+
pattern: $BAR
|
|
377
|
+
- kind: import_specifier
|
|
378
|
+
not:
|
|
379
|
+
has:
|
|
380
|
+
field: alias
|
|
381
|
+
kind: identifier
|
|
382
|
+
has:
|
|
383
|
+
field: name
|
|
384
|
+
pattern: $BAR
|
|
385
|
+
areachart-import:
|
|
386
|
+
kind: import_statement
|
|
387
|
+
all:
|
|
388
|
+
- has:
|
|
389
|
+
field: source
|
|
390
|
+
regex: ^["']@ngrok/mantle/area-chart["']$
|
|
391
|
+
- has:
|
|
392
|
+
stopBy: end
|
|
393
|
+
kind: import_specifier
|
|
394
|
+
has:
|
|
395
|
+
field: name
|
|
396
|
+
regex: ^AreaChart$
|
|
397
|
+
any:
|
|
398
|
+
- kind: import_specifier
|
|
399
|
+
has:
|
|
400
|
+
field: alias
|
|
401
|
+
pattern: $AREA
|
|
402
|
+
- kind: import_specifier
|
|
403
|
+
not:
|
|
404
|
+
has:
|
|
405
|
+
field: alias
|
|
406
|
+
kind: identifier
|
|
407
|
+
has:
|
|
408
|
+
field: name
|
|
409
|
+
pattern: $AREA
|
|
410
|
+
scatterplot-import:
|
|
411
|
+
kind: import_statement
|
|
412
|
+
all:
|
|
413
|
+
- has:
|
|
414
|
+
field: source
|
|
415
|
+
regex: ^["']@ngrok/mantle/scatter-plot["']$
|
|
416
|
+
- has:
|
|
417
|
+
stopBy: end
|
|
418
|
+
kind: import_specifier
|
|
419
|
+
has:
|
|
420
|
+
field: name
|
|
421
|
+
regex: ^ScatterPlot$
|
|
422
|
+
any:
|
|
423
|
+
- kind: import_specifier
|
|
424
|
+
has:
|
|
425
|
+
field: alias
|
|
426
|
+
pattern: $SCATTER
|
|
427
|
+
- kind: import_specifier
|
|
428
|
+
not:
|
|
429
|
+
has:
|
|
430
|
+
field: alias
|
|
431
|
+
kind: identifier
|
|
432
|
+
has:
|
|
433
|
+
field: name
|
|
434
|
+
pattern: $SCATTER
|
|
435
|
+
chart-root:
|
|
436
|
+
any:
|
|
437
|
+
- kind: jsx_opening_element
|
|
438
|
+
- kind: jsx_self_closing_element
|
|
439
|
+
has:
|
|
440
|
+
field: name
|
|
441
|
+
kind: member_expression
|
|
442
|
+
any:
|
|
443
|
+
- all:
|
|
444
|
+
- has:
|
|
445
|
+
field: object
|
|
446
|
+
pattern: $LINE
|
|
447
|
+
- has:
|
|
448
|
+
field: property
|
|
449
|
+
regex: ^Root$
|
|
450
|
+
- inside:
|
|
451
|
+
stopBy: end
|
|
452
|
+
kind: program
|
|
453
|
+
has:
|
|
454
|
+
matches: linechart-import
|
|
455
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
456
|
+
# rules cannot tell which binding the element reads.
|
|
457
|
+
- not:
|
|
458
|
+
inside:
|
|
459
|
+
stopBy: end
|
|
460
|
+
matches: scope
|
|
461
|
+
has:
|
|
462
|
+
stopBy:
|
|
463
|
+
matches: scope
|
|
464
|
+
any:
|
|
465
|
+
- matches: binding-name
|
|
466
|
+
pattern: $LINE
|
|
467
|
+
- matches: function-declaration
|
|
468
|
+
has:
|
|
469
|
+
field: name
|
|
470
|
+
pattern: $LINE
|
|
471
|
+
- all:
|
|
472
|
+
- has:
|
|
473
|
+
field: object
|
|
474
|
+
pattern: $BAR
|
|
475
|
+
- has:
|
|
476
|
+
field: property
|
|
477
|
+
regex: ^Root$
|
|
478
|
+
- inside:
|
|
479
|
+
stopBy: end
|
|
480
|
+
kind: program
|
|
481
|
+
has:
|
|
482
|
+
matches: barchart-import
|
|
483
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
484
|
+
# rules cannot tell which binding the element reads.
|
|
485
|
+
- not:
|
|
486
|
+
inside:
|
|
487
|
+
stopBy: end
|
|
488
|
+
matches: scope
|
|
489
|
+
has:
|
|
490
|
+
stopBy:
|
|
491
|
+
matches: scope
|
|
492
|
+
any:
|
|
493
|
+
- matches: binding-name
|
|
494
|
+
pattern: $BAR
|
|
495
|
+
- matches: function-declaration
|
|
496
|
+
has:
|
|
497
|
+
field: name
|
|
498
|
+
pattern: $BAR
|
|
499
|
+
- all:
|
|
500
|
+
- has:
|
|
501
|
+
field: object
|
|
502
|
+
pattern: $AREA
|
|
503
|
+
- has:
|
|
504
|
+
field: property
|
|
505
|
+
regex: ^Root$
|
|
506
|
+
- inside:
|
|
507
|
+
stopBy: end
|
|
508
|
+
kind: program
|
|
509
|
+
has:
|
|
510
|
+
matches: areachart-import
|
|
511
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
512
|
+
# rules cannot tell which binding the element reads.
|
|
513
|
+
- not:
|
|
514
|
+
inside:
|
|
515
|
+
stopBy: end
|
|
516
|
+
matches: scope
|
|
517
|
+
has:
|
|
518
|
+
stopBy:
|
|
519
|
+
matches: scope
|
|
520
|
+
any:
|
|
521
|
+
- matches: binding-name
|
|
522
|
+
pattern: $AREA
|
|
523
|
+
- matches: function-declaration
|
|
524
|
+
has:
|
|
525
|
+
field: name
|
|
526
|
+
pattern: $AREA
|
|
527
|
+
- all:
|
|
528
|
+
- has:
|
|
529
|
+
field: object
|
|
530
|
+
pattern: $SCATTER
|
|
531
|
+
- has:
|
|
532
|
+
field: property
|
|
533
|
+
regex: ^Root$
|
|
534
|
+
- inside:
|
|
535
|
+
stopBy: end
|
|
536
|
+
kind: program
|
|
537
|
+
has:
|
|
538
|
+
matches: scatterplot-import
|
|
539
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
540
|
+
# rules cannot tell which binding the element reads.
|
|
541
|
+
- not:
|
|
542
|
+
inside:
|
|
543
|
+
stopBy: end
|
|
544
|
+
matches: scope
|
|
545
|
+
has:
|
|
546
|
+
stopBy:
|
|
547
|
+
matches: scope
|
|
548
|
+
any:
|
|
549
|
+
- matches: binding-name
|
|
550
|
+
pattern: $SCATTER
|
|
551
|
+
- matches: function-declaration
|
|
552
|
+
has:
|
|
553
|
+
field: name
|
|
554
|
+
pattern: $SCATTER
|
|
555
|
+
rule:
|
|
556
|
+
kind: jsx_attribute
|
|
557
|
+
pattern:
|
|
558
|
+
context: <Root decorative={$FLAG} />
|
|
559
|
+
selector: jsx_attribute
|
|
560
|
+
inside:
|
|
561
|
+
matches: chart-root
|
|
562
|
+
# Why a kind list: a ternary needs parentheses as the test of another ternary,
|
|
563
|
+
# and so do `??`, `as`, and `await`. The formatter strips them from the rest.
|
|
564
|
+
constraints:
|
|
565
|
+
FLAG:
|
|
566
|
+
not:
|
|
567
|
+
any:
|
|
568
|
+
- kind: ternary_expression
|
|
569
|
+
- kind: as_expression
|
|
570
|
+
- kind: satisfies_expression
|
|
571
|
+
- kind: assignment_expression
|
|
572
|
+
- kind: augmented_assignment_expression
|
|
573
|
+
- kind: await_expression
|
|
574
|
+
- kind: sequence_expression
|
|
575
|
+
- kind: arrow_function
|
|
576
|
+
- kind: function_expression
|
|
577
|
+
- kind: yield_expression
|
|
578
|
+
- kind: "true"
|
|
579
|
+
- kind: binary_expression
|
|
580
|
+
regex: \?\?
|
|
581
|
+
fix: 'mode={$FLAG ? "decorative" : "interactive"}'
|
|
582
|
+
---
|
|
583
|
+
id: chart-decorative-compound-expression
|
|
584
|
+
language: tsx
|
|
585
|
+
message: a dynamic decorative flag picks between the decorative and interactive modes
|
|
586
|
+
utils:
|
|
587
|
+
# A node that opens a lexical scope. The shadow search below stops at a
|
|
588
|
+
# nested one, so a sibling function's local name does not count.
|
|
589
|
+
scope:
|
|
590
|
+
any:
|
|
591
|
+
- kind: statement_block
|
|
592
|
+
- kind: function_declaration
|
|
593
|
+
- kind: generator_function_declaration
|
|
594
|
+
- kind: function_expression
|
|
595
|
+
- kind: generator_function
|
|
596
|
+
- kind: arrow_function
|
|
597
|
+
- kind: method_definition
|
|
598
|
+
- kind: class_body
|
|
599
|
+
- kind: for_statement
|
|
600
|
+
- kind: for_in_statement
|
|
601
|
+
- kind: catch_clause
|
|
602
|
+
# An identifier in a binding position: a parameter, a destructured name, a
|
|
603
|
+
# local variable, a function name, or a class name.
|
|
604
|
+
binding-name:
|
|
605
|
+
any:
|
|
606
|
+
- kind: shorthand_property_identifier_pattern
|
|
607
|
+
- kind: identifier
|
|
608
|
+
any:
|
|
609
|
+
- inside: { kind: variable_declarator, field: name }
|
|
610
|
+
- inside: { kind: function_declaration, field: name }
|
|
611
|
+
- inside: { kind: generator_function_declaration, field: name }
|
|
612
|
+
- inside: { kind: function_expression, field: name }
|
|
613
|
+
- inside: { kind: required_parameter, field: pattern }
|
|
614
|
+
- inside: { kind: optional_parameter, field: pattern }
|
|
615
|
+
- inside: { kind: assignment_pattern, field: left }
|
|
616
|
+
- inside: { kind: pair_pattern, field: value }
|
|
617
|
+
- inside: { kind: array_pattern }
|
|
618
|
+
- inside: { kind: rest_pattern }
|
|
619
|
+
- inside: { kind: arrow_function, field: parameter }
|
|
620
|
+
- inside: { kind: catch_clause, field: parameter }
|
|
621
|
+
- kind: type_identifier
|
|
622
|
+
inside: { kind: class_declaration, field: name }
|
|
623
|
+
# A function declaration opens a scope, so the search above stops at it and
|
|
624
|
+
# never reads its name. This matches the declaration itself instead.
|
|
625
|
+
function-declaration:
|
|
626
|
+
any:
|
|
627
|
+
- kind: function_declaration
|
|
628
|
+
- kind: generator_function_declaration
|
|
629
|
+
linechart-import:
|
|
630
|
+
kind: import_statement
|
|
631
|
+
all:
|
|
632
|
+
- has:
|
|
633
|
+
field: source
|
|
634
|
+
regex: ^["']@ngrok/mantle/line-chart["']$
|
|
635
|
+
- has:
|
|
636
|
+
stopBy: end
|
|
637
|
+
kind: import_specifier
|
|
638
|
+
has:
|
|
639
|
+
field: name
|
|
640
|
+
regex: ^LineChart$
|
|
641
|
+
any:
|
|
642
|
+
- kind: import_specifier
|
|
643
|
+
has:
|
|
644
|
+
field: alias
|
|
645
|
+
pattern: $LINE
|
|
646
|
+
- kind: import_specifier
|
|
647
|
+
not:
|
|
648
|
+
has:
|
|
649
|
+
field: alias
|
|
650
|
+
kind: identifier
|
|
651
|
+
has:
|
|
652
|
+
field: name
|
|
653
|
+
pattern: $LINE
|
|
654
|
+
barchart-import:
|
|
655
|
+
kind: import_statement
|
|
656
|
+
all:
|
|
657
|
+
- has:
|
|
658
|
+
field: source
|
|
659
|
+
regex: ^["']@ngrok/mantle/bar-chart["']$
|
|
660
|
+
- has:
|
|
661
|
+
stopBy: end
|
|
662
|
+
kind: import_specifier
|
|
663
|
+
has:
|
|
664
|
+
field: name
|
|
665
|
+
regex: ^BarChart$
|
|
666
|
+
any:
|
|
667
|
+
- kind: import_specifier
|
|
668
|
+
has:
|
|
669
|
+
field: alias
|
|
670
|
+
pattern: $BAR
|
|
671
|
+
- kind: import_specifier
|
|
672
|
+
not:
|
|
673
|
+
has:
|
|
674
|
+
field: alias
|
|
675
|
+
kind: identifier
|
|
676
|
+
has:
|
|
677
|
+
field: name
|
|
678
|
+
pattern: $BAR
|
|
679
|
+
areachart-import:
|
|
680
|
+
kind: import_statement
|
|
681
|
+
all:
|
|
682
|
+
- has:
|
|
683
|
+
field: source
|
|
684
|
+
regex: ^["']@ngrok/mantle/area-chart["']$
|
|
685
|
+
- has:
|
|
686
|
+
stopBy: end
|
|
687
|
+
kind: import_specifier
|
|
688
|
+
has:
|
|
689
|
+
field: name
|
|
690
|
+
regex: ^AreaChart$
|
|
691
|
+
any:
|
|
692
|
+
- kind: import_specifier
|
|
693
|
+
has:
|
|
694
|
+
field: alias
|
|
695
|
+
pattern: $AREA
|
|
696
|
+
- kind: import_specifier
|
|
697
|
+
not:
|
|
698
|
+
has:
|
|
699
|
+
field: alias
|
|
700
|
+
kind: identifier
|
|
701
|
+
has:
|
|
702
|
+
field: name
|
|
703
|
+
pattern: $AREA
|
|
704
|
+
scatterplot-import:
|
|
705
|
+
kind: import_statement
|
|
706
|
+
all:
|
|
707
|
+
- has:
|
|
708
|
+
field: source
|
|
709
|
+
regex: ^["']@ngrok/mantle/scatter-plot["']$
|
|
710
|
+
- has:
|
|
711
|
+
stopBy: end
|
|
712
|
+
kind: import_specifier
|
|
713
|
+
has:
|
|
714
|
+
field: name
|
|
715
|
+
regex: ^ScatterPlot$
|
|
716
|
+
any:
|
|
717
|
+
- kind: import_specifier
|
|
718
|
+
has:
|
|
719
|
+
field: alias
|
|
720
|
+
pattern: $SCATTER
|
|
721
|
+
- kind: import_specifier
|
|
722
|
+
not:
|
|
723
|
+
has:
|
|
724
|
+
field: alias
|
|
725
|
+
kind: identifier
|
|
726
|
+
has:
|
|
727
|
+
field: name
|
|
728
|
+
pattern: $SCATTER
|
|
729
|
+
chart-root:
|
|
730
|
+
any:
|
|
731
|
+
- kind: jsx_opening_element
|
|
732
|
+
- kind: jsx_self_closing_element
|
|
733
|
+
has:
|
|
734
|
+
field: name
|
|
735
|
+
kind: member_expression
|
|
736
|
+
any:
|
|
737
|
+
- all:
|
|
738
|
+
- has:
|
|
739
|
+
field: object
|
|
740
|
+
pattern: $LINE
|
|
741
|
+
- has:
|
|
742
|
+
field: property
|
|
743
|
+
regex: ^Root$
|
|
744
|
+
- inside:
|
|
745
|
+
stopBy: end
|
|
746
|
+
kind: program
|
|
747
|
+
has:
|
|
748
|
+
matches: linechart-import
|
|
749
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
750
|
+
# rules cannot tell which binding the element reads.
|
|
751
|
+
- not:
|
|
752
|
+
inside:
|
|
753
|
+
stopBy: end
|
|
754
|
+
matches: scope
|
|
755
|
+
has:
|
|
756
|
+
stopBy:
|
|
757
|
+
matches: scope
|
|
758
|
+
any:
|
|
759
|
+
- matches: binding-name
|
|
760
|
+
pattern: $LINE
|
|
761
|
+
- matches: function-declaration
|
|
762
|
+
has:
|
|
763
|
+
field: name
|
|
764
|
+
pattern: $LINE
|
|
765
|
+
- all:
|
|
766
|
+
- has:
|
|
767
|
+
field: object
|
|
768
|
+
pattern: $BAR
|
|
769
|
+
- has:
|
|
770
|
+
field: property
|
|
771
|
+
regex: ^Root$
|
|
772
|
+
- inside:
|
|
773
|
+
stopBy: end
|
|
774
|
+
kind: program
|
|
775
|
+
has:
|
|
776
|
+
matches: barchart-import
|
|
777
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
778
|
+
# rules cannot tell which binding the element reads.
|
|
779
|
+
- not:
|
|
780
|
+
inside:
|
|
781
|
+
stopBy: end
|
|
782
|
+
matches: scope
|
|
783
|
+
has:
|
|
784
|
+
stopBy:
|
|
785
|
+
matches: scope
|
|
786
|
+
any:
|
|
787
|
+
- matches: binding-name
|
|
788
|
+
pattern: $BAR
|
|
789
|
+
- matches: function-declaration
|
|
790
|
+
has:
|
|
791
|
+
field: name
|
|
792
|
+
pattern: $BAR
|
|
793
|
+
- all:
|
|
794
|
+
- has:
|
|
795
|
+
field: object
|
|
796
|
+
pattern: $AREA
|
|
797
|
+
- has:
|
|
798
|
+
field: property
|
|
799
|
+
regex: ^Root$
|
|
800
|
+
- inside:
|
|
801
|
+
stopBy: end
|
|
802
|
+
kind: program
|
|
803
|
+
has:
|
|
804
|
+
matches: areachart-import
|
|
805
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
806
|
+
# rules cannot tell which binding the element reads.
|
|
807
|
+
- not:
|
|
808
|
+
inside:
|
|
809
|
+
stopBy: end
|
|
810
|
+
matches: scope
|
|
811
|
+
has:
|
|
812
|
+
stopBy:
|
|
813
|
+
matches: scope
|
|
814
|
+
any:
|
|
815
|
+
- matches: binding-name
|
|
816
|
+
pattern: $AREA
|
|
817
|
+
- matches: function-declaration
|
|
818
|
+
has:
|
|
819
|
+
field: name
|
|
820
|
+
pattern: $AREA
|
|
821
|
+
- all:
|
|
822
|
+
- has:
|
|
823
|
+
field: object
|
|
824
|
+
pattern: $SCATTER
|
|
825
|
+
- has:
|
|
826
|
+
field: property
|
|
827
|
+
regex: ^Root$
|
|
828
|
+
- inside:
|
|
829
|
+
stopBy: end
|
|
830
|
+
kind: program
|
|
831
|
+
has:
|
|
832
|
+
matches: scatterplot-import
|
|
833
|
+
# Why: a parameter or a local under the import's name shadows it, and the
|
|
834
|
+
# rules cannot tell which binding the element reads.
|
|
835
|
+
- not:
|
|
836
|
+
inside:
|
|
837
|
+
stopBy: end
|
|
838
|
+
matches: scope
|
|
839
|
+
has:
|
|
840
|
+
stopBy:
|
|
841
|
+
matches: scope
|
|
842
|
+
any:
|
|
843
|
+
- matches: binding-name
|
|
844
|
+
pattern: $SCATTER
|
|
845
|
+
- matches: function-declaration
|
|
846
|
+
has:
|
|
847
|
+
field: name
|
|
848
|
+
pattern: $SCATTER
|
|
849
|
+
rule:
|
|
850
|
+
kind: jsx_attribute
|
|
851
|
+
pattern:
|
|
852
|
+
context: <Root decorative={$FLAG} />
|
|
853
|
+
selector: jsx_attribute
|
|
854
|
+
inside:
|
|
855
|
+
matches: chart-root
|
|
856
|
+
constraints:
|
|
857
|
+
FLAG:
|
|
858
|
+
any:
|
|
859
|
+
- kind: ternary_expression
|
|
860
|
+
- kind: as_expression
|
|
861
|
+
- kind: satisfies_expression
|
|
862
|
+
- kind: assignment_expression
|
|
863
|
+
- kind: augmented_assignment_expression
|
|
864
|
+
- kind: await_expression
|
|
865
|
+
- kind: sequence_expression
|
|
866
|
+
- kind: arrow_function
|
|
867
|
+
- kind: function_expression
|
|
868
|
+
- kind: yield_expression
|
|
869
|
+
- kind: binary_expression
|
|
870
|
+
regex: \?\?
|
|
871
|
+
fix: 'mode={($FLAG) ? "decorative" : "interactive"}'
|