@ngrok/mantle 0.88.0 → 0.90.0

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.
Files changed (247) hide show
  1. package/dist/accordion.d.ts +10 -9
  2. package/dist/accordion.js +1 -1
  3. package/dist/agent.json +1530 -1
  4. package/dist/{alert-DCVfviBx.d.ts → alert-BzPDUaU7.d.ts} +16 -15
  5. package/dist/alert-DO00UiQe.js +1 -0
  6. package/dist/alert-ZaUBtgno.js +1 -0
  7. package/dist/alert-center.d.ts +7 -7
  8. package/dist/alert-center.js +1 -1
  9. package/dist/alert-dialog.d.ts +17 -16
  10. package/dist/alert-dialog.js +1 -1
  11. package/dist/alert.d.ts +1 -1
  12. package/dist/alert.js +1 -1
  13. package/dist/anchor-CgcbWEUs.js +1 -0
  14. package/dist/anchor.js +1 -1
  15. package/dist/app-layout.d.ts +1183 -45
  16. package/dist/app-layout.js +1 -1
  17. package/dist/area-chart.d.ts +41 -18
  18. package/dist/area-chart.js +1 -1
  19. package/dist/avatar.js +1 -1
  20. package/dist/badge.d.ts +3 -2
  21. package/dist/badge.js +1 -1
  22. package/dist/bar-chart.d.ts +37 -13
  23. package/dist/bar-chart.js +1 -1
  24. package/dist/breadcrumb.js +1 -1
  25. package/dist/browser-only.js +1 -1
  26. package/dist/button-69InNC_m.js +1 -0
  27. package/dist/button-BMfUxs_j.js +1 -0
  28. package/dist/{button-DO53OA70.d.ts → button-CHoYpOzx.d.ts} +5 -4
  29. package/dist/{button-B52_vczK.js → button-D8rr-1AB.js} +1 -1
  30. package/dist/{button-crUf0hbR.d.ts → button-DL7V4bzW.d.ts} +5 -4
  31. package/dist/button-b2HKEIE2.js +1 -0
  32. package/dist/{button-B5i9n7Qp.d.ts → button-mzUR1U0Y.d.ts} +5 -4
  33. package/dist/button.d.ts +3 -3
  34. package/dist/button.js +1 -1
  35. package/dist/calendar.d.ts +3 -2
  36. package/dist/calendar.js +1 -1
  37. package/dist/card.d.ts +15 -7
  38. package/dist/card.js +1 -1
  39. package/dist/centered-layout.js +1 -1
  40. package/dist/{chart-DgaWVBqi.d.ts → chart-23KQ1ZNO.d.ts} +128 -62
  41. package/dist/chart-BRkJfptA.js +2 -0
  42. package/dist/checkbox-C3N2afhB.js +1 -0
  43. package/dist/checkbox.d.ts +3 -2
  44. package/dist/checkbox.js +1 -1
  45. package/dist/{choice-PESu-9s8.d.ts → choice-BCiyqLgO.d.ts} +12 -11
  46. package/dist/choice-DQmecLfy.js +1 -0
  47. package/dist/choice.d.ts +1 -1
  48. package/dist/choice.js +1 -1
  49. package/dist/code-block-4Esx_gV-.js +12 -0
  50. package/dist/code-block.d.ts +17 -16
  51. package/dist/code-block.js +6 -6
  52. package/dist/code-block_highlight-utils.js +1 -1
  53. package/dist/code.d.ts +2 -1
  54. package/dist/code.js +1 -1
  55. package/dist/combobox.d.ts +15 -14
  56. package/dist/combobox.js +1 -1
  57. package/dist/command.d.ts +13 -13
  58. package/dist/command.js +1 -1
  59. package/dist/cx-CK7o_rVv.js +1 -0
  60. package/dist/cx.js +1 -1
  61. package/dist/data-table.d.ts +32 -31
  62. package/dist/data-table.js +1 -1
  63. package/dist/description-list.d.ts +6 -6
  64. package/dist/description-list.js +1 -1
  65. package/dist/dialog-CaGJD02w.js +1 -0
  66. package/dist/{dialog-DXpqpdJj.d.ts → dialog-DQdeqvq-.d.ts} +28 -15
  67. package/dist/dialog.d.ts +1 -1
  68. package/dist/dialog.js +1 -1
  69. package/dist/{dropdown-menu-BloQKE_y.d.ts → dropdown-menu-Cef0Cz2B.d.ts} +17 -17
  70. package/dist/dropdown-menu-CutWQ0bl.js +1 -0
  71. package/dist/dropdown-menu-DMA8dGxZ.d.ts +1 -0
  72. package/dist/dropdown-menu.d.ts +2 -2
  73. package/dist/dropdown-menu.js +1 -1
  74. package/dist/empty.d.ts +14 -6
  75. package/dist/empty.js +1 -1
  76. package/dist/field.d.ts +16 -15
  77. package/dist/field.js +1 -1
  78. package/dist/flag.d.ts +4 -3
  79. package/dist/flag.js +1 -1
  80. package/dist/hooks.d.ts +251 -1
  81. package/dist/hooks.js +1 -1
  82. package/dist/hover-card.d.ts +5 -4
  83. package/dist/hover-card.js +1 -1
  84. package/dist/icon-BudQMD2S.js +1 -0
  85. package/dist/icon-kK0c-POG.js +1 -0
  86. package/dist/{icon-w0HUe7tr.d.ts → icon-r2NvfTWW.d.ts} +3 -2
  87. package/dist/{icon-BmJ57Tgh.d.ts → icon-ucVgZeXn.d.ts} +3 -2
  88. package/dist/icon.d.ts +2 -2
  89. package/dist/icon.js +1 -1
  90. package/dist/icons-CAtjMNti.js +1 -0
  91. package/dist/{icons-Bu-2boul.js → icons-CH3tD_wq.js} +1 -1
  92. package/dist/icons-CSwTVV2m.js +1 -0
  93. package/dist/icons.js +1 -1
  94. package/dist/in-view-Dxv_GrUU.js +1 -0
  95. package/dist/input-D_DjD9lT.js +1 -0
  96. package/dist/{input-DpnC3Xgj.d.ts → input-bbB1tC0h.d.ts} +3 -2
  97. package/dist/input.d.ts +5 -4
  98. package/dist/input.js +1 -1
  99. package/dist/kbd-CLHsJ99p.js +1 -0
  100. package/dist/kbd.d.ts +2 -1
  101. package/dist/kbd.js +1 -1
  102. package/dist/label-5T8i7I4X.js +1 -0
  103. package/dist/{label-Bnfe9YJ6.d.ts → label-C-KbNls8.d.ts} +3 -2
  104. package/dist/label.d.ts +1 -1
  105. package/dist/label.js +1 -1
  106. package/dist/{layer-container-R7aux3n8.js → layer-container-DLf-6eBz.js} +1 -1
  107. package/dist/layer-container.js +1 -1
  108. package/dist/line-chart.d.ts +40 -15
  109. package/dist/line-chart.js +1 -1
  110. package/dist/list-DOVZoz9t.js +1 -0
  111. package/dist/list.d.ts +3 -2
  112. package/dist/list.js +1 -1
  113. package/dist/live-region-DQ1QLv3L.js +1 -0
  114. package/dist/live-region.d.ts +3 -2
  115. package/dist/live-region.js +1 -1
  116. package/dist/llms.txt +118 -2
  117. package/dist/{main-Dv2zuT_b.js → main-CC1L9IsH.js} +1 -1
  118. package/dist/main.js +1 -1
  119. package/dist/mantle.css +12 -0
  120. package/dist/media-object.js +1 -1
  121. package/dist/migrations/0002-data-table-action-header.yml +526 -0
  122. package/dist/migrations/0003-dialog-footer-dom-order.yml +271 -0
  123. package/dist/migrations/0004-priority-to-intent.yml +1728 -0
  124. package/dist/migrations/0005-field-item-owns-control-id.yml +234 -0
  125. package/dist/migrations/0006-data-table-tanstack-v9.yml +423 -0
  126. package/dist/migrations/0008-tabs-separator.yml +1212 -0
  127. package/dist/migrations/0009-chart-root-mode.yml +871 -0
  128. package/dist/multi-select.d.ts +23 -22
  129. package/dist/multi-select.js +1 -1
  130. package/dist/otp-input.d.ts +9 -8
  131. package/dist/otp-input.js +1 -1
  132. package/dist/pagination.d.ts +9 -8
  133. package/dist/pagination.js +1 -1
  134. package/dist/{popover-Cco1nw8I.d.ts → popover-Dvls7-j4.d.ts} +5 -4
  135. package/dist/popover-oQDUvcZ2.js +1 -0
  136. package/dist/popover.d.ts +1 -1
  137. package/dist/popover.js +1 -1
  138. package/dist/primitive-AGoxSJBI.js +1 -0
  139. package/dist/progress.d.ts +9 -8
  140. package/dist/progress.js +1 -1
  141. package/dist/qr-code.d.ts +9 -8
  142. package/dist/qr-code.js +1 -1
  143. package/dist/radio-group.d.ts +19 -18
  144. package/dist/radio-group.js +1 -1
  145. package/dist/sandbar.d.ts +7 -7
  146. package/dist/sandbar.js +1 -1
  147. package/dist/{sandboxed-on-click-BLvvSqOP.js → sandboxed-on-click-C7pPu-2M.js} +1 -1
  148. package/dist/sandboxed-on-click.js +1 -1
  149. package/dist/scatter-plot.d.ts +39 -14
  150. package/dist/scatter-plot.js +1 -1
  151. package/dist/select-DcL0-duV.js +1 -0
  152. package/dist/{select-BITJP7I5.d.ts → select-DlohFa54.d.ts} +3 -3
  153. package/dist/select.d.ts +1 -1
  154. package/dist/select.js +1 -1
  155. package/dist/selectable-list.d.ts +16 -15
  156. package/dist/selectable-list.js +1 -1
  157. package/dist/{separator-Bo4nY_3M.d.ts → separator-BWGjCIl7.d.ts} +11 -3
  158. package/dist/separator-DvPe27fH.js +1 -0
  159. package/dist/separator.d.ts +1 -1
  160. package/dist/separator.js +1 -1
  161. package/dist/sheet-H8zvhSuA.js +1 -0
  162. package/dist/sheet.d.ts +13 -12
  163. package/dist/sheet.js +1 -1
  164. package/dist/sidebar.d.ts +163 -102
  165. package/dist/sidebar.js +1 -1
  166. package/dist/skeleton-zfqoDAxT.js +1 -0
  167. package/dist/skeleton.d.ts +3 -2
  168. package/dist/skeleton.js +1 -1
  169. package/dist/skip-to-main-link.js +1 -1
  170. package/dist/slider.d.ts +3 -2
  171. package/dist/slider.js +1 -1
  172. package/dist/{slot-BsvE2ntj.js → slot-DdYN1L1C.js} +1 -1
  173. package/dist/{slot-DdgxmuI5.d.ts → slot-Q996Hqk9.d.ts} +1 -1
  174. package/dist/slot.d.ts +1 -1
  175. package/dist/slot.js +1 -1
  176. package/dist/split-button.d.ts +6 -5
  177. package/dist/split-button.js +1 -1
  178. package/dist/strata.d.ts +544 -0
  179. package/dist/strata.js +1 -0
  180. package/dist/switch.d.ts +3 -2
  181. package/dist/switch.js +1 -1
  182. package/dist/{table-DEI-qvSC.d.ts → table-BhzITa19.d.ts} +10 -9
  183. package/dist/table-DBbKqOVq.js +1 -0
  184. package/dist/table.d.ts +1 -1
  185. package/dist/table.js +1 -1
  186. package/dist/tabs.d.ts +2 -2
  187. package/dist/tabs.js +1 -1
  188. package/dist/text-area.d.ts +3 -2
  189. package/dist/text-area.js +1 -1
  190. package/dist/theme-6Q65C1Rx.js +1 -0
  191. package/dist/theme-switcher.d.ts +3 -3
  192. package/dist/theme-switcher.js +1 -1
  193. package/dist/theme.js +1 -1
  194. package/dist/toast.d.ts +10 -9
  195. package/dist/toast.js +1 -1
  196. package/dist/{tooltip-nuUCoqq8.d.ts → tooltip-CngH7Kl6.d.ts} +7 -6
  197. package/dist/tooltip-NhYXqStK.js +1 -0
  198. package/dist/tooltip.d.ts +1 -1
  199. package/dist/tooltip.js +1 -1
  200. package/dist/truncated-text.d.ts +138 -0
  201. package/dist/truncated-text.js +1 -0
  202. package/dist/types.js +1 -1
  203. package/dist/use-breakpoint--mo7kr9d.js +1 -0
  204. package/dist/use-is-hydrated-after-paint-r9Cl2mGp.js +1 -0
  205. package/dist/use-prefers-reduced-motion-DimzRx-M.js +1 -0
  206. package/dist/use-swipe-to-dismiss-Cj-AayFd.js +1 -0
  207. package/dist/utils.js +1 -1
  208. package/dist/visually-hidden.d.ts +2 -1
  209. package/dist/visually-hidden.js +1 -1
  210. package/dist/well.d.ts +10 -2
  211. package/dist/well.js +1 -1
  212. package/package.json +17 -15
  213. package/dist/alert-OP_-aGJD.js +0 -1
  214. package/dist/anchor-BnMhJYS4.js +0 -1
  215. package/dist/button-BFpCB99R.js +0 -1
  216. package/dist/button-Dij5vCQG.js +0 -1
  217. package/dist/button-pwkdtR3U.js +0 -1
  218. package/dist/chart-aZLMj4xx.js +0 -2
  219. package/dist/checkbox-DbJSqSNN.js +0 -1
  220. package/dist/choice-SRyLguqU.js +0 -1
  221. package/dist/code-block-BE3Q0iAo.js +0 -12
  222. package/dist/cx-0HCjnNv1.js +0 -1
  223. package/dist/dialog-HIdb5d3I.js +0 -1
  224. package/dist/dropdown-menu-BR_AQNMj.js +0 -1
  225. package/dist/dropdown-menu-Dlpb7600.d.ts +0 -1
  226. package/dist/icon-BT8FnkkJ.js +0 -1
  227. package/dist/icon-U24NfYv7.js +0 -1
  228. package/dist/icons-BQRcOU6J.js +0 -1
  229. package/dist/icons-C3rVfpx9.js +0 -1
  230. package/dist/in-view-T_AAYaaF.js +0 -1
  231. package/dist/input-yq0jLE4e.js +0 -1
  232. package/dist/kbd-CJ8hNZfS.js +0 -1
  233. package/dist/label-BAy0Mg59.js +0 -1
  234. package/dist/list-BleZ-43e.js +0 -1
  235. package/dist/live-region-B2vJRvPH.js +0 -1
  236. package/dist/popover-BJ5XNwzD.js +0 -1
  237. package/dist/primitive-w3wFk2La.js +0 -1
  238. package/dist/select-CUWLEeuf.js +0 -1
  239. package/dist/separator-D98be0gY.js +0 -1
  240. package/dist/sheet-B5x8EO9Y.js +0 -1
  241. package/dist/skeleton-bVDP8BzY.js +0 -1
  242. package/dist/table-D2jh52KA.js +0 -1
  243. package/dist/theme-C1kFFdIk.js +0 -1
  244. package/dist/tooltip-H03l7E4Y.js +0 -1
  245. package/dist/use-is-hydrated-after-paint-Drj0lNi4.js +0 -1
  246. package/dist/use-prefers-reduced-motion-Cj9tJ181.js +0 -1
  247. /package/dist/{types-D85fCNV3.js → css-properties-D85fCNV3.js} +0 -0
@@ -0,0 +1,234 @@
1
+ # Every rule binds $FIELD to the local name of the `Field` import from
2
+ # `@ngrok/mantle/field`, so an aliased import matches and another library's
3
+ # `Field` does not.
4
+ id: field-label-drop-html-for
5
+ language: tsx
6
+ message: Field.Label no longer takes htmlFor; Field.Item owns the control id
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
+ field-import:
51
+ kind: import_statement
52
+ all:
53
+ - has:
54
+ field: source
55
+ regex: ^["']@ngrok/mantle/field["']$
56
+ - has:
57
+ stopBy: end
58
+ kind: import_specifier
59
+ has:
60
+ field: name
61
+ regex: ^Field$
62
+ any:
63
+ - kind: import_specifier
64
+ has:
65
+ field: alias
66
+ pattern: $FIELD
67
+ - kind: import_specifier
68
+ not:
69
+ has:
70
+ field: alias
71
+ kind: identifier
72
+ has:
73
+ field: name
74
+ pattern: $FIELD
75
+ label-name:
76
+ kind: member_expression
77
+ all:
78
+ - has:
79
+ field: object
80
+ pattern: $FIELD
81
+ - has:
82
+ field: property
83
+ regex: ^Label$
84
+ rule:
85
+ kind: jsx_attribute
86
+ has:
87
+ kind: property_identifier
88
+ regex: ^htmlFor$
89
+ inside:
90
+ any:
91
+ - kind: jsx_opening_element
92
+ - kind: jsx_self_closing_element
93
+ all:
94
+ - has:
95
+ field: name
96
+ matches: label-name
97
+ - inside:
98
+ stopBy: end
99
+ kind: program
100
+ has:
101
+ matches: field-import
102
+ # Why: a parameter or a local under the import's name shadows it, and the
103
+ # rules cannot tell which binding the element reads.
104
+ - not:
105
+ inside:
106
+ stopBy: end
107
+ matches: scope
108
+ has:
109
+ stopBy:
110
+ matches: scope
111
+ any:
112
+ - matches: binding-name
113
+ pattern: $FIELD
114
+ - matches: function-declaration
115
+ has:
116
+ field: name
117
+ pattern: $FIELD
118
+ fix: ""
119
+ ---
120
+ id: field-control-drop-id
121
+ language: tsx
122
+ message: Field.Control no longer takes id; Field.Item owns the control id
123
+ utils:
124
+ # A node that opens a lexical scope. The shadow search below stops at a
125
+ # nested one, so a sibling function's local name does not count.
126
+ scope:
127
+ any:
128
+ - kind: statement_block
129
+ - kind: function_declaration
130
+ - kind: generator_function_declaration
131
+ - kind: function_expression
132
+ - kind: generator_function
133
+ - kind: arrow_function
134
+ - kind: method_definition
135
+ - kind: class_body
136
+ - kind: for_statement
137
+ - kind: for_in_statement
138
+ - kind: catch_clause
139
+ # An identifier in a binding position: a parameter, a destructured name, a
140
+ # local variable, a function name, or a class name.
141
+ binding-name:
142
+ any:
143
+ - kind: shorthand_property_identifier_pattern
144
+ - kind: identifier
145
+ any:
146
+ - inside: { kind: variable_declarator, field: name }
147
+ - inside: { kind: function_declaration, field: name }
148
+ - inside: { kind: generator_function_declaration, field: name }
149
+ - inside: { kind: function_expression, field: name }
150
+ - inside: { kind: required_parameter, field: pattern }
151
+ - inside: { kind: optional_parameter, field: pattern }
152
+ - inside: { kind: assignment_pattern, field: left }
153
+ - inside: { kind: pair_pattern, field: value }
154
+ - inside: { kind: array_pattern }
155
+ - inside: { kind: rest_pattern }
156
+ - inside: { kind: arrow_function, field: parameter }
157
+ - inside: { kind: catch_clause, field: parameter }
158
+ - kind: type_identifier
159
+ inside: { kind: class_declaration, field: name }
160
+ # A function declaration opens a scope, so the search above stops at it and
161
+ # never reads its name. This matches the declaration itself instead.
162
+ function-declaration:
163
+ any:
164
+ - kind: function_declaration
165
+ - kind: generator_function_declaration
166
+ field-import:
167
+ kind: import_statement
168
+ all:
169
+ - has:
170
+ field: source
171
+ regex: ^["']@ngrok/mantle/field["']$
172
+ - has:
173
+ stopBy: end
174
+ kind: import_specifier
175
+ has:
176
+ field: name
177
+ regex: ^Field$
178
+ any:
179
+ - kind: import_specifier
180
+ has:
181
+ field: alias
182
+ pattern: $FIELD
183
+ - kind: import_specifier
184
+ not:
185
+ has:
186
+ field: alias
187
+ kind: identifier
188
+ has:
189
+ field: name
190
+ pattern: $FIELD
191
+ control-name:
192
+ kind: member_expression
193
+ all:
194
+ - has:
195
+ field: object
196
+ pattern: $FIELD
197
+ - has:
198
+ field: property
199
+ regex: ^Control$
200
+ rule:
201
+ kind: jsx_attribute
202
+ has:
203
+ kind: property_identifier
204
+ regex: ^id$
205
+ inside:
206
+ any:
207
+ - kind: jsx_opening_element
208
+ - kind: jsx_self_closing_element
209
+ all:
210
+ - has:
211
+ field: name
212
+ matches: control-name
213
+ - inside:
214
+ stopBy: end
215
+ kind: program
216
+ has:
217
+ matches: field-import
218
+ # Why: a parameter or a local under the import's name shadows it, and the
219
+ # rules cannot tell which binding the element reads.
220
+ - not:
221
+ inside:
222
+ stopBy: end
223
+ matches: scope
224
+ has:
225
+ stopBy:
226
+ matches: scope
227
+ any:
228
+ - matches: binding-name
229
+ pattern: $FIELD
230
+ - matches: function-declaration
231
+ has:
232
+ field: name
233
+ pattern: $FIELD
234
+ fix: ""
@@ -0,0 +1,423 @@
1
+ # Every rule runs only in a file that imports from `@ngrok/mantle/data-table`,
2
+ # and the TypeScript copies reach a `.ts` module that holds column definitions.
3
+ id: column-sorting-fn
4
+ language: tsx
5
+ message: a column's sortingFn option is sortFn in TanStack Table v9
6
+ utils:
7
+ data-table-import:
8
+ kind: import_statement
9
+ has:
10
+ field: source
11
+ regex: ^["']@ngrok/mantle/data-table["']$
12
+ in-data-table-file:
13
+ kind: program
14
+ has:
15
+ matches: data-table-import
16
+ # A column helper call: `columnHelper.accessor(…)`, `.display(…)`, or
17
+ # `.group(…)`.
18
+ column-helper-call:
19
+ kind: call_expression
20
+ has:
21
+ field: function
22
+ kind: member_expression
23
+ has:
24
+ field: property
25
+ regex: ^(accessor|display|group)$
26
+ # An object literal that is a column definition: the options of a column
27
+ # helper call, an element of a `columns` array, or an object with a column
28
+ # key. Row data with a `sortingFn` field is none of these.
29
+ column-options:
30
+ kind: object
31
+ any:
32
+ - inside:
33
+ kind: arguments
34
+ inside:
35
+ matches: column-helper-call
36
+ - inside:
37
+ kind: array
38
+ any:
39
+ - inside:
40
+ kind: arguments
41
+ inside:
42
+ kind: call_expression
43
+ has:
44
+ field: function
45
+ kind: member_expression
46
+ has:
47
+ field: property
48
+ regex: ^columns$
49
+ - inside:
50
+ kind: pair
51
+ has:
52
+ field: key
53
+ regex: ^columns$
54
+ - has:
55
+ kind: pair
56
+ has:
57
+ field: key
58
+ regex: ^(accessorKey|accessorFn|header|cell)$
59
+ rule:
60
+ pattern:
61
+ context: "({ sortingFn: $VALUE })"
62
+ selector: pair
63
+ all:
64
+ - inside:
65
+ matches: column-options
66
+ - inside:
67
+ stopBy: end
68
+ matches: in-data-table-file
69
+ fix: "sortFn: $VALUE"
70
+ ---
71
+ id: table-get-state
72
+ language: tsx
73
+ message: table.getState() is the table.state property in TanStack Table v9
74
+ utils:
75
+ data-table-import:
76
+ kind: import_statement
77
+ has:
78
+ field: source
79
+ regex: ^["']@ngrok/mantle/data-table["']$
80
+ in-data-table-file:
81
+ kind: program
82
+ has:
83
+ matches: data-table-import
84
+ # A node that opens a lexical scope. The binding searches below stop at a
85
+ # nested one, so a sibling function's local name does not count.
86
+ scope:
87
+ any:
88
+ - kind: statement_block
89
+ - kind: function_declaration
90
+ - kind: generator_function_declaration
91
+ - kind: function_expression
92
+ - kind: generator_function
93
+ - kind: arrow_function
94
+ - kind: method_definition
95
+ - kind: class_body
96
+ - kind: for_statement
97
+ - kind: for_in_statement
98
+ - kind: catch_clause
99
+ scope-or-program:
100
+ any:
101
+ - matches: scope
102
+ - kind: program
103
+ # An identifier in a binding position: a parameter, a destructured name, a
104
+ # local variable, a function name, or a class name.
105
+ binding-name:
106
+ any:
107
+ - kind: shorthand_property_identifier_pattern
108
+ - kind: identifier
109
+ any:
110
+ - inside: { kind: variable_declarator, field: name }
111
+ - inside: { kind: function_declaration, field: name }
112
+ - inside: { kind: generator_function_declaration, field: name }
113
+ - inside: { kind: function_expression, field: name }
114
+ - inside: { kind: required_parameter, field: pattern }
115
+ - inside: { kind: optional_parameter, field: pattern }
116
+ - inside: { kind: assignment_pattern, field: left }
117
+ - inside: { kind: pair_pattern, field: value }
118
+ - inside: { kind: array_pattern }
119
+ - inside: { kind: rest_pattern }
120
+ - inside: { kind: arrow_function, field: parameter }
121
+ - inside: { kind: catch_clause, field: parameter }
122
+ - kind: type_identifier
123
+ inside: { kind: class_declaration, field: name }
124
+ # A function declaration opens a scope, so the search above stops at it and
125
+ # never reads its name. This matches the declaration itself instead.
126
+ function-declaration:
127
+ any:
128
+ - kind: function_declaration
129
+ - kind: generator_function_declaration
130
+ # The instance a `useTable` call returns, under whatever name it is bound to.
131
+ table-binding:
132
+ kind: variable_declarator
133
+ all:
134
+ - has:
135
+ field: name
136
+ pattern: $TABLE
137
+ - has:
138
+ field: value
139
+ pattern: useTable($$$)
140
+ # A variable under the table's name whose value is not a `useTable` call:
141
+ # a store, a state machine, or any other object with a `getState` method.
142
+ other-declarator:
143
+ kind: variable_declarator
144
+ has:
145
+ field: name
146
+ pattern: $TABLE
147
+ not:
148
+ matches: table-binding
149
+ # The nearest enclosing scope that declares the table with `useTable`.
150
+ table-scope:
151
+ matches: scope-or-program
152
+ has:
153
+ stopBy:
154
+ matches: scope
155
+ matches: table-binding
156
+ rule:
157
+ pattern: $TABLE.getState()
158
+ inside:
159
+ stopBy: end
160
+ matches: in-data-table-file
161
+ # Why three shapes: a column callback receives the instance as `table`, and
162
+ # a prop carries it under a name that ends in `table`, with no declaration
163
+ # in the file to bind to. The dry run is the check on that last one.
164
+ any:
165
+ - pattern: table.getState()
166
+ not:
167
+ inside:
168
+ stopBy: end
169
+ matches: scope-or-program
170
+ has:
171
+ stopBy:
172
+ matches: scope
173
+ matches: other-declarator
174
+ - pattern: $TABLE.getState()
175
+ has:
176
+ field: function
177
+ has:
178
+ field: object
179
+ regex: (?i)table$
180
+ not:
181
+ inside:
182
+ stopBy: end
183
+ matches: scope-or-program
184
+ has:
185
+ stopBy:
186
+ matches: scope
187
+ matches: other-declarator
188
+ - pattern: $TABLE.getState()
189
+ inside:
190
+ stopBy: end
191
+ matches: table-scope
192
+ # Why: a parameter or a local under the table's name, between the read
193
+ # and the `useTable` call, shadows the table.
194
+ not:
195
+ inside:
196
+ stopBy:
197
+ matches: table-scope
198
+ matches: scope-or-program
199
+ has:
200
+ stopBy:
201
+ matches: scope
202
+ any:
203
+ - matches: binding-name
204
+ pattern: $TABLE
205
+ not:
206
+ inside:
207
+ matches: table-binding
208
+ - matches: function-declaration
209
+ has:
210
+ field: name
211
+ pattern: $TABLE
212
+ fix: $TABLE.state
213
+ ---
214
+ id: column-sorting-fn
215
+ language: typescript
216
+ message: a column's sortingFn option is sortFn in TanStack Table v9
217
+ utils:
218
+ data-table-import:
219
+ kind: import_statement
220
+ has:
221
+ field: source
222
+ regex: ^["']@ngrok/mantle/data-table["']$
223
+ in-data-table-file:
224
+ kind: program
225
+ has:
226
+ matches: data-table-import
227
+ # A column helper call: `columnHelper.accessor(…)`, `.display(…)`, or
228
+ # `.group(…)`.
229
+ column-helper-call:
230
+ kind: call_expression
231
+ has:
232
+ field: function
233
+ kind: member_expression
234
+ has:
235
+ field: property
236
+ regex: ^(accessor|display|group)$
237
+ # An object literal that is a column definition: the options of a column
238
+ # helper call, an element of a `columns` array, or an object with a column
239
+ # key. Row data with a `sortingFn` field is none of these.
240
+ column-options:
241
+ kind: object
242
+ any:
243
+ - inside:
244
+ kind: arguments
245
+ inside:
246
+ matches: column-helper-call
247
+ - inside:
248
+ kind: array
249
+ any:
250
+ - inside:
251
+ kind: arguments
252
+ inside:
253
+ kind: call_expression
254
+ has:
255
+ field: function
256
+ kind: member_expression
257
+ has:
258
+ field: property
259
+ regex: ^columns$
260
+ - inside:
261
+ kind: pair
262
+ has:
263
+ field: key
264
+ regex: ^columns$
265
+ - has:
266
+ kind: pair
267
+ has:
268
+ field: key
269
+ regex: ^(accessorKey|accessorFn|header|cell)$
270
+ rule:
271
+ pattern:
272
+ context: "({ sortingFn: $VALUE })"
273
+ selector: pair
274
+ all:
275
+ - inside:
276
+ matches: column-options
277
+ - inside:
278
+ stopBy: end
279
+ matches: in-data-table-file
280
+ fix: "sortFn: $VALUE"
281
+ ---
282
+ id: table-get-state
283
+ language: typescript
284
+ message: table.getState() is the table.state property in TanStack Table v9
285
+ utils:
286
+ data-table-import:
287
+ kind: import_statement
288
+ has:
289
+ field: source
290
+ regex: ^["']@ngrok/mantle/data-table["']$
291
+ in-data-table-file:
292
+ kind: program
293
+ has:
294
+ matches: data-table-import
295
+ # A node that opens a lexical scope. The binding searches below stop at a
296
+ # nested one, so a sibling function's local name does not count.
297
+ scope:
298
+ any:
299
+ - kind: statement_block
300
+ - kind: function_declaration
301
+ - kind: generator_function_declaration
302
+ - kind: function_expression
303
+ - kind: generator_function
304
+ - kind: arrow_function
305
+ - kind: method_definition
306
+ - kind: class_body
307
+ - kind: for_statement
308
+ - kind: for_in_statement
309
+ - kind: catch_clause
310
+ scope-or-program:
311
+ any:
312
+ - matches: scope
313
+ - kind: program
314
+ # An identifier in a binding position: a parameter, a destructured name, a
315
+ # local variable, a function name, or a class name.
316
+ binding-name:
317
+ any:
318
+ - kind: shorthand_property_identifier_pattern
319
+ - kind: identifier
320
+ any:
321
+ - inside: { kind: variable_declarator, field: name }
322
+ - inside: { kind: function_declaration, field: name }
323
+ - inside: { kind: generator_function_declaration, field: name }
324
+ - inside: { kind: function_expression, field: name }
325
+ - inside: { kind: required_parameter, field: pattern }
326
+ - inside: { kind: optional_parameter, field: pattern }
327
+ - inside: { kind: assignment_pattern, field: left }
328
+ - inside: { kind: pair_pattern, field: value }
329
+ - inside: { kind: array_pattern }
330
+ - inside: { kind: rest_pattern }
331
+ - inside: { kind: arrow_function, field: parameter }
332
+ - inside: { kind: catch_clause, field: parameter }
333
+ - kind: type_identifier
334
+ inside: { kind: class_declaration, field: name }
335
+ # A function declaration opens a scope, so the search above stops at it and
336
+ # never reads its name. This matches the declaration itself instead.
337
+ function-declaration:
338
+ any:
339
+ - kind: function_declaration
340
+ - kind: generator_function_declaration
341
+ # The instance a `useTable` call returns, under whatever name it is bound to.
342
+ table-binding:
343
+ kind: variable_declarator
344
+ all:
345
+ - has:
346
+ field: name
347
+ pattern: $TABLE
348
+ - has:
349
+ field: value
350
+ pattern: useTable($$$)
351
+ # A variable under the table's name whose value is not a `useTable` call:
352
+ # a store, a state machine, or any other object with a `getState` method.
353
+ other-declarator:
354
+ kind: variable_declarator
355
+ has:
356
+ field: name
357
+ pattern: $TABLE
358
+ not:
359
+ matches: table-binding
360
+ # The nearest enclosing scope that declares the table with `useTable`.
361
+ table-scope:
362
+ matches: scope-or-program
363
+ has:
364
+ stopBy:
365
+ matches: scope
366
+ matches: table-binding
367
+ rule:
368
+ pattern: $TABLE.getState()
369
+ inside:
370
+ stopBy: end
371
+ matches: in-data-table-file
372
+ # Why three shapes: a column callback receives the instance as `table`, and
373
+ # a prop carries it under a name that ends in `table`, with no declaration
374
+ # in the file to bind to. The dry run is the check on that last one.
375
+ any:
376
+ - pattern: table.getState()
377
+ not:
378
+ inside:
379
+ stopBy: end
380
+ matches: scope-or-program
381
+ has:
382
+ stopBy:
383
+ matches: scope
384
+ matches: other-declarator
385
+ - pattern: $TABLE.getState()
386
+ has:
387
+ field: function
388
+ has:
389
+ field: object
390
+ regex: (?i)table$
391
+ not:
392
+ inside:
393
+ stopBy: end
394
+ matches: scope-or-program
395
+ has:
396
+ stopBy:
397
+ matches: scope
398
+ matches: other-declarator
399
+ - pattern: $TABLE.getState()
400
+ inside:
401
+ stopBy: end
402
+ matches: table-scope
403
+ # Why: a parameter or a local under the table's name, between the read
404
+ # and the `useTable` call, shadows the table.
405
+ not:
406
+ inside:
407
+ stopBy:
408
+ matches: table-scope
409
+ matches: scope-or-program
410
+ has:
411
+ stopBy:
412
+ matches: scope
413
+ any:
414
+ - matches: binding-name
415
+ pattern: $TABLE
416
+ not:
417
+ inside:
418
+ matches: table-binding
419
+ - matches: function-declaration
420
+ has:
421
+ field: name
422
+ pattern: $TABLE
423
+ fix: $TABLE.state