@colrealpro/react-luau-doctor 0.19.0 → 0.20.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.
- package/CHANGELOG.md +41 -0
- package/LICENSE +21 -21
- package/README.md +148 -135
- package/THIRD_PARTY_NOTICES.md +25 -18
- package/dist/cli.js +13352 -11433
- package/dist/cli.js.map +60 -49
- package/dist/config.schema.json +548 -0
- package/dist/scan-worker.js +3561 -1592
- package/dist/scan-worker.js.map +45 -36
- package/package.json +13 -3
- package/vendor/tree-sitter-luau.LICENSE +21 -21
- package/vendor/tree-sitter-luau.wasm +0 -0
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"title": "React-Luau Doctor project config",
|
|
4
|
+
"type": "object",
|
|
5
|
+
"additionalProperties": false,
|
|
6
|
+
"properties": {
|
|
7
|
+
"$schema": {
|
|
8
|
+
"type": "string",
|
|
9
|
+
"description": "JSON schema used by your editor"
|
|
10
|
+
},
|
|
11
|
+
"include": {
|
|
12
|
+
"type": "array",
|
|
13
|
+
"items": {
|
|
14
|
+
"type": "string"
|
|
15
|
+
},
|
|
16
|
+
"description": "File globs to include in project scans"
|
|
17
|
+
},
|
|
18
|
+
"ignore": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "string"
|
|
22
|
+
},
|
|
23
|
+
"description": "File globs and directories to exclude from project scans"
|
|
24
|
+
},
|
|
25
|
+
"projects": {
|
|
26
|
+
"type": "array",
|
|
27
|
+
"items": {
|
|
28
|
+
"type": "string"
|
|
29
|
+
},
|
|
30
|
+
"description": "Project directories to scan"
|
|
31
|
+
},
|
|
32
|
+
"rules": {
|
|
33
|
+
"type": "object",
|
|
34
|
+
"description": "Override a rule severity or turn it off for this project",
|
|
35
|
+
"additionalProperties": false,
|
|
36
|
+
"properties": {
|
|
37
|
+
"react-luau/parse-error": {
|
|
38
|
+
"type": "string",
|
|
39
|
+
"enum": [
|
|
40
|
+
"off",
|
|
41
|
+
"error",
|
|
42
|
+
"warning",
|
|
43
|
+
"suggestion"
|
|
44
|
+
],
|
|
45
|
+
"default": "error",
|
|
46
|
+
"description": "Report executable Luau syntax that the bundled parser cannot form into a complete syntax tree"
|
|
47
|
+
},
|
|
48
|
+
"react-luau/rules-of-hooks": {
|
|
49
|
+
"type": "string",
|
|
50
|
+
"enum": [
|
|
51
|
+
"off",
|
|
52
|
+
"error",
|
|
53
|
+
"warning",
|
|
54
|
+
"suggestion"
|
|
55
|
+
],
|
|
56
|
+
"default": "error",
|
|
57
|
+
"description": "Hooks must run in the same order on every render of a React component or custom hook"
|
|
58
|
+
},
|
|
59
|
+
"react-luau/exhaustive-deps": {
|
|
60
|
+
"type": "string",
|
|
61
|
+
"enum": [
|
|
62
|
+
"off",
|
|
63
|
+
"error",
|
|
64
|
+
"warning",
|
|
65
|
+
"suggestion"
|
|
66
|
+
],
|
|
67
|
+
"default": "warning",
|
|
68
|
+
"description": "React hook dependency tables should include captured reactive render values"
|
|
69
|
+
},
|
|
70
|
+
"react-luau/effect-needs-cleanup": {
|
|
71
|
+
"type": "string",
|
|
72
|
+
"enum": [
|
|
73
|
+
"off",
|
|
74
|
+
"error",
|
|
75
|
+
"warning",
|
|
76
|
+
"suggestion"
|
|
77
|
+
],
|
|
78
|
+
"default": "warning",
|
|
79
|
+
"description": "Effects that create owned resources or outliving tasks should return matching cleanup"
|
|
80
|
+
},
|
|
81
|
+
"react-luau/no-derived-state-effect": {
|
|
82
|
+
"type": "string",
|
|
83
|
+
"enum": [
|
|
84
|
+
"off",
|
|
85
|
+
"error",
|
|
86
|
+
"warning",
|
|
87
|
+
"suggestion"
|
|
88
|
+
],
|
|
89
|
+
"default": "warning",
|
|
90
|
+
"description": "Avoid copying render-known derived values into state from an effect"
|
|
91
|
+
},
|
|
92
|
+
"react-luau/no-self-updating-effect": {
|
|
93
|
+
"type": "string",
|
|
94
|
+
"enum": [
|
|
95
|
+
"off",
|
|
96
|
+
"error",
|
|
97
|
+
"warning",
|
|
98
|
+
"suggestion"
|
|
99
|
+
],
|
|
100
|
+
"default": "warning",
|
|
101
|
+
"description": "Effects should not unconditionally update state in a way that schedules themselves again"
|
|
102
|
+
},
|
|
103
|
+
"react-luau/no-effect-with-fresh-deps": {
|
|
104
|
+
"type": "string",
|
|
105
|
+
"enum": [
|
|
106
|
+
"off",
|
|
107
|
+
"error",
|
|
108
|
+
"warning",
|
|
109
|
+
"suggestion"
|
|
110
|
+
],
|
|
111
|
+
"default": "error",
|
|
112
|
+
"description": "Dependency tables should not contain tables or functions recreated on every render"
|
|
113
|
+
},
|
|
114
|
+
"react-luau/no-mutable-in-deps": {
|
|
115
|
+
"type": "string",
|
|
116
|
+
"enum": [
|
|
117
|
+
"off",
|
|
118
|
+
"error",
|
|
119
|
+
"warning",
|
|
120
|
+
"suggestion"
|
|
121
|
+
],
|
|
122
|
+
"default": "error",
|
|
123
|
+
"description": "Mutable ref.current values do not belong in hook dependency tables"
|
|
124
|
+
},
|
|
125
|
+
"react-luau/prefer-binding-over-state": {
|
|
126
|
+
"type": "string",
|
|
127
|
+
"enum": [
|
|
128
|
+
"off",
|
|
129
|
+
"error",
|
|
130
|
+
"warning",
|
|
131
|
+
"suggestion"
|
|
132
|
+
],
|
|
133
|
+
"default": "warning",
|
|
134
|
+
"description": "Prefer React.useBinding when proven external presentation streams do not need React reconciliation"
|
|
135
|
+
},
|
|
136
|
+
"react-luau/prefer-binding-over-state-candidate": {
|
|
137
|
+
"type": "string",
|
|
138
|
+
"enum": [
|
|
139
|
+
"off",
|
|
140
|
+
"error",
|
|
141
|
+
"warning",
|
|
142
|
+
"suggestion"
|
|
143
|
+
],
|
|
144
|
+
"default": "suggestion",
|
|
145
|
+
"description": "Surface lower-confidence state-to-Binding opportunities that need developer review"
|
|
146
|
+
},
|
|
147
|
+
"react-luau/rerender-unstable-memo-props": {
|
|
148
|
+
"type": "string",
|
|
149
|
+
"enum": [
|
|
150
|
+
"off",
|
|
151
|
+
"error",
|
|
152
|
+
"warning",
|
|
153
|
+
"suggestion"
|
|
154
|
+
],
|
|
155
|
+
"default": "warning",
|
|
156
|
+
"description": "Warn when fresh table or function props defeat shallow React.memo comparisons"
|
|
157
|
+
},
|
|
158
|
+
"react-luau/rerender-high-frequency-state": {
|
|
159
|
+
"type": "string",
|
|
160
|
+
"enum": [
|
|
161
|
+
"off",
|
|
162
|
+
"error",
|
|
163
|
+
"warning",
|
|
164
|
+
"suggestion"
|
|
165
|
+
],
|
|
166
|
+
"default": "warning",
|
|
167
|
+
"description": "Find state updates from frame callbacks that can rerender expensive component trees continuously"
|
|
168
|
+
},
|
|
169
|
+
"react-luau/rerender-unnecessary-usememo": {
|
|
170
|
+
"type": "string",
|
|
171
|
+
"enum": [
|
|
172
|
+
"off",
|
|
173
|
+
"error",
|
|
174
|
+
"warning",
|
|
175
|
+
"suggestion"
|
|
176
|
+
],
|
|
177
|
+
"default": "warning",
|
|
178
|
+
"description": "Find trivial derived values that cost more to memoize than to compute directly"
|
|
179
|
+
},
|
|
180
|
+
"react-luau/rerender-unnecessary-usecallback": {
|
|
181
|
+
"type": "string",
|
|
182
|
+
"enum": [
|
|
183
|
+
"off",
|
|
184
|
+
"error",
|
|
185
|
+
"warning",
|
|
186
|
+
"suggestion"
|
|
187
|
+
],
|
|
188
|
+
"default": "warning",
|
|
189
|
+
"description": "Find useCallback values whose stable function identity is never observed"
|
|
190
|
+
},
|
|
191
|
+
"react-luau/rerender-static-discovery-in-render": {
|
|
192
|
+
"type": "string",
|
|
193
|
+
"enum": [
|
|
194
|
+
"off",
|
|
195
|
+
"error",
|
|
196
|
+
"warning",
|
|
197
|
+
"suggestion"
|
|
198
|
+
],
|
|
199
|
+
"default": "warning",
|
|
200
|
+
"description": "Find static Instance/module discovery repeated during component render"
|
|
201
|
+
},
|
|
202
|
+
"react-luau/rerender-repeated-collection-scan": {
|
|
203
|
+
"type": "string",
|
|
204
|
+
"enum": [
|
|
205
|
+
"off",
|
|
206
|
+
"error",
|
|
207
|
+
"warning",
|
|
208
|
+
"suggestion"
|
|
209
|
+
],
|
|
210
|
+
"default": "warning",
|
|
211
|
+
"description": "Find repeated direct render passes over the same collection expression"
|
|
212
|
+
},
|
|
213
|
+
"react-luau/rerender-static-state": {
|
|
214
|
+
"type": "string",
|
|
215
|
+
"enum": [
|
|
216
|
+
"off",
|
|
217
|
+
"error",
|
|
218
|
+
"warning",
|
|
219
|
+
"suggestion"
|
|
220
|
+
],
|
|
221
|
+
"default": "warning",
|
|
222
|
+
"description": "Find React state whose setter is never used and therefore cannot change"
|
|
223
|
+
},
|
|
224
|
+
"react-luau/prefer-use-ref-for-mutable-cell": {
|
|
225
|
+
"type": "string",
|
|
226
|
+
"enum": [
|
|
227
|
+
"off",
|
|
228
|
+
"error",
|
|
229
|
+
"warning",
|
|
230
|
+
"suggestion"
|
|
231
|
+
],
|
|
232
|
+
"default": "suggestion",
|
|
233
|
+
"description": "Prefer useRef over useMemo-created tables that only emulate a mutable current cell"
|
|
234
|
+
},
|
|
235
|
+
"react-luau/rerender-functional-setstate": {
|
|
236
|
+
"type": "string",
|
|
237
|
+
"enum": [
|
|
238
|
+
"off",
|
|
239
|
+
"error",
|
|
240
|
+
"warning",
|
|
241
|
+
"suggestion"
|
|
242
|
+
],
|
|
243
|
+
"default": "warning",
|
|
244
|
+
"description": "Use the functional state setter form when deferred callbacks update from the previous state value"
|
|
245
|
+
},
|
|
246
|
+
"react-luau/rerender-lazy-state-init": {
|
|
247
|
+
"type": "string",
|
|
248
|
+
"enum": [
|
|
249
|
+
"off",
|
|
250
|
+
"error",
|
|
251
|
+
"warning",
|
|
252
|
+
"suggestion"
|
|
253
|
+
],
|
|
254
|
+
"default": "warning",
|
|
255
|
+
"description": "Expensive useState initializers should use React's lazy initializer form"
|
|
256
|
+
},
|
|
257
|
+
"react-luau/rerender-lazy-ref-init": {
|
|
258
|
+
"type": "string",
|
|
259
|
+
"enum": [
|
|
260
|
+
"off",
|
|
261
|
+
"error",
|
|
262
|
+
"warning",
|
|
263
|
+
"suggestion"
|
|
264
|
+
],
|
|
265
|
+
"default": "warning",
|
|
266
|
+
"description": "Avoid eagerly rebuilding expensive values passed to useRef on every render"
|
|
267
|
+
},
|
|
268
|
+
"react-luau/rerender-state-only-in-handlers": {
|
|
269
|
+
"type": "string",
|
|
270
|
+
"enum": [
|
|
271
|
+
"off",
|
|
272
|
+
"error",
|
|
273
|
+
"warning",
|
|
274
|
+
"suggestion"
|
|
275
|
+
],
|
|
276
|
+
"default": "warning",
|
|
277
|
+
"description": "State that is only read from callbacks may be mutable data rather than rendered state"
|
|
278
|
+
},
|
|
279
|
+
"react-luau/no-set-state-in-render": {
|
|
280
|
+
"type": "string",
|
|
281
|
+
"enum": [
|
|
282
|
+
"off",
|
|
283
|
+
"error",
|
|
284
|
+
"warning",
|
|
285
|
+
"suggestion"
|
|
286
|
+
],
|
|
287
|
+
"default": "warning",
|
|
288
|
+
"description": "Do not call a component's state setter unconditionally during render"
|
|
289
|
+
},
|
|
290
|
+
"react-luau/no-mutating-state-updater": {
|
|
291
|
+
"type": "string",
|
|
292
|
+
"enum": [
|
|
293
|
+
"off",
|
|
294
|
+
"error",
|
|
295
|
+
"warning",
|
|
296
|
+
"suggestion"
|
|
297
|
+
],
|
|
298
|
+
"default": "error",
|
|
299
|
+
"description": "Do not mutate previous state inside a state updater"
|
|
300
|
+
},
|
|
301
|
+
"react-luau/no-call-component-as-function": {
|
|
302
|
+
"type": "string",
|
|
303
|
+
"enum": [
|
|
304
|
+
"off",
|
|
305
|
+
"error",
|
|
306
|
+
"warning",
|
|
307
|
+
"suggestion"
|
|
308
|
+
],
|
|
309
|
+
"default": "warning",
|
|
310
|
+
"description": "Render components with React.createElement instead of calling them directly"
|
|
311
|
+
},
|
|
312
|
+
"react-luau/no-create-binding-in-render": {
|
|
313
|
+
"type": "string",
|
|
314
|
+
"enum": [
|
|
315
|
+
"off",
|
|
316
|
+
"error",
|
|
317
|
+
"warning",
|
|
318
|
+
"suggestion"
|
|
319
|
+
],
|
|
320
|
+
"default": "warning",
|
|
321
|
+
"description": "Preserve binding identity across function component renders"
|
|
322
|
+
},
|
|
323
|
+
"react-luau/no-binding-getvalue-in-render": {
|
|
324
|
+
"type": "string",
|
|
325
|
+
"enum": [
|
|
326
|
+
"off",
|
|
327
|
+
"error",
|
|
328
|
+
"warning",
|
|
329
|
+
"suggestion"
|
|
330
|
+
],
|
|
331
|
+
"default": "warning",
|
|
332
|
+
"description": "Do not read binding snapshots during render except to initialize a ref"
|
|
333
|
+
},
|
|
334
|
+
"react-luau/usememo-must-return": {
|
|
335
|
+
"type": "string",
|
|
336
|
+
"enum": [
|
|
337
|
+
"off",
|
|
338
|
+
"error",
|
|
339
|
+
"warning",
|
|
340
|
+
"suggestion"
|
|
341
|
+
],
|
|
342
|
+
"default": "warning",
|
|
343
|
+
"description": "Memo calculations must return their computed value"
|
|
344
|
+
},
|
|
345
|
+
"react-luau/no-direct-state-mutation": {
|
|
346
|
+
"type": "string",
|
|
347
|
+
"enum": [
|
|
348
|
+
"off",
|
|
349
|
+
"error",
|
|
350
|
+
"warning",
|
|
351
|
+
"suggestion"
|
|
352
|
+
],
|
|
353
|
+
"default": "warning",
|
|
354
|
+
"description": "Do not mutate table state in place"
|
|
355
|
+
},
|
|
356
|
+
"react-luau/no-ref-current-in-render": {
|
|
357
|
+
"type": "string",
|
|
358
|
+
"enum": [
|
|
359
|
+
"off",
|
|
360
|
+
"error",
|
|
361
|
+
"warning",
|
|
362
|
+
"suggestion"
|
|
363
|
+
],
|
|
364
|
+
"default": "warning",
|
|
365
|
+
"description": "Avoid mutating ref.current during render except for predictable initialization or deliberate latest-value mirrors"
|
|
366
|
+
},
|
|
367
|
+
"react-luau/no-create-context-in-render": {
|
|
368
|
+
"type": "string",
|
|
369
|
+
"enum": [
|
|
370
|
+
"off",
|
|
371
|
+
"error",
|
|
372
|
+
"warning",
|
|
373
|
+
"suggestion"
|
|
374
|
+
],
|
|
375
|
+
"default": "error",
|
|
376
|
+
"description": "React contexts must have stable identity and should not be created during render"
|
|
377
|
+
},
|
|
378
|
+
"react-luau/no-nested-component-definition": {
|
|
379
|
+
"type": "string",
|
|
380
|
+
"enum": [
|
|
381
|
+
"off",
|
|
382
|
+
"error",
|
|
383
|
+
"warning",
|
|
384
|
+
"suggestion"
|
|
385
|
+
],
|
|
386
|
+
"default": "warning",
|
|
387
|
+
"description": "Do not define rendered component types inside another component"
|
|
388
|
+
},
|
|
389
|
+
"react-luau/no-random-key": {
|
|
390
|
+
"type": "string",
|
|
391
|
+
"enum": [
|
|
392
|
+
"off",
|
|
393
|
+
"error",
|
|
394
|
+
"warning",
|
|
395
|
+
"suggestion"
|
|
396
|
+
],
|
|
397
|
+
"default": "error",
|
|
398
|
+
"description": "React child keys must not be regenerated on each render"
|
|
399
|
+
},
|
|
400
|
+
"react-luau/no-yield-in-render": {
|
|
401
|
+
"type": "string",
|
|
402
|
+
"enum": [
|
|
403
|
+
"off",
|
|
404
|
+
"error",
|
|
405
|
+
"warning",
|
|
406
|
+
"suggestion"
|
|
407
|
+
],
|
|
408
|
+
"default": "error",
|
|
409
|
+
"description": "React render functions must not yield"
|
|
410
|
+
},
|
|
411
|
+
"react-luau/no-task-spawn-in-render": {
|
|
412
|
+
"type": "string",
|
|
413
|
+
"enum": [
|
|
414
|
+
"off",
|
|
415
|
+
"error",
|
|
416
|
+
"warning",
|
|
417
|
+
"suggestion"
|
|
418
|
+
],
|
|
419
|
+
"default": "error",
|
|
420
|
+
"description": "Do not schedule asynchronous work during render"
|
|
421
|
+
},
|
|
422
|
+
"react-luau/no-side-effects-in-render": {
|
|
423
|
+
"type": "string",
|
|
424
|
+
"enum": [
|
|
425
|
+
"off",
|
|
426
|
+
"error",
|
|
427
|
+
"warning",
|
|
428
|
+
"suggestion"
|
|
429
|
+
],
|
|
430
|
+
"default": "error",
|
|
431
|
+
"description": "Do not create Instances, start tweens, subscribe, or perform other externally observable side effects during component render"
|
|
432
|
+
},
|
|
433
|
+
"react-luau/no-create-root-in-render": {
|
|
434
|
+
"type": "string",
|
|
435
|
+
"enum": [
|
|
436
|
+
"off",
|
|
437
|
+
"error",
|
|
438
|
+
"warning",
|
|
439
|
+
"suggestion"
|
|
440
|
+
],
|
|
441
|
+
"default": "error",
|
|
442
|
+
"description": "Do not create ReactRoblox roots during component render"
|
|
443
|
+
},
|
|
444
|
+
"react-luau/no-prop-mutation": {
|
|
445
|
+
"type": "string",
|
|
446
|
+
"enum": [
|
|
447
|
+
"off",
|
|
448
|
+
"error",
|
|
449
|
+
"warning",
|
|
450
|
+
"suggestion"
|
|
451
|
+
],
|
|
452
|
+
"default": "error",
|
|
453
|
+
"description": "Component props should be treated as immutable inputs"
|
|
454
|
+
},
|
|
455
|
+
"react-luau/no-static-name-prop": {
|
|
456
|
+
"type": "string",
|
|
457
|
+
"enum": [
|
|
458
|
+
"off",
|
|
459
|
+
"error",
|
|
460
|
+
"warning",
|
|
461
|
+
"suggestion"
|
|
462
|
+
],
|
|
463
|
+
"default": "warning",
|
|
464
|
+
"description": "Name Roblox instance children through their table keys instead of a static Name prop"
|
|
465
|
+
},
|
|
466
|
+
"react-luau/no-array-index-as-key": {
|
|
467
|
+
"type": "string",
|
|
468
|
+
"enum": [
|
|
469
|
+
"off",
|
|
470
|
+
"error",
|
|
471
|
+
"warning",
|
|
472
|
+
"suggestion"
|
|
473
|
+
],
|
|
474
|
+
"default": "suggestion",
|
|
475
|
+
"description": "Review dynamic React children that use their current array position as identity"
|
|
476
|
+
},
|
|
477
|
+
"react-luau/unstable-context-value": {
|
|
478
|
+
"type": "string",
|
|
479
|
+
"enum": [
|
|
480
|
+
"off",
|
|
481
|
+
"error",
|
|
482
|
+
"warning",
|
|
483
|
+
"suggestion"
|
|
484
|
+
],
|
|
485
|
+
"default": "warning",
|
|
486
|
+
"description": "Avoid recreating context value tables on every provider render when identity matters"
|
|
487
|
+
}
|
|
488
|
+
}
|
|
489
|
+
},
|
|
490
|
+
"categories": {
|
|
491
|
+
"type": "array",
|
|
492
|
+
"items": {
|
|
493
|
+
"type": "string",
|
|
494
|
+
"enum": [
|
|
495
|
+
"Correctness",
|
|
496
|
+
"Hooks",
|
|
497
|
+
"Effects",
|
|
498
|
+
"Performance",
|
|
499
|
+
"Roblox",
|
|
500
|
+
"Architecture"
|
|
501
|
+
]
|
|
502
|
+
},
|
|
503
|
+
"description": "Limit findings to these categories"
|
|
504
|
+
},
|
|
505
|
+
"scope": {
|
|
506
|
+
"type": "string",
|
|
507
|
+
"enum": [
|
|
508
|
+
"full",
|
|
509
|
+
"files",
|
|
510
|
+
"changed",
|
|
511
|
+
"lines"
|
|
512
|
+
],
|
|
513
|
+
"description": "Choose which files or changed lines to report"
|
|
514
|
+
},
|
|
515
|
+
"diff": {
|
|
516
|
+
"type": [
|
|
517
|
+
"boolean",
|
|
518
|
+
"string"
|
|
519
|
+
],
|
|
520
|
+
"description": "Report introduced findings against HEAD or a specific Git ref"
|
|
521
|
+
},
|
|
522
|
+
"base": {
|
|
523
|
+
"type": "string",
|
|
524
|
+
"description": "Git ref used as the baseline for changed scope"
|
|
525
|
+
},
|
|
526
|
+
"verbose": {
|
|
527
|
+
"type": "boolean",
|
|
528
|
+
"description": "Include detailed findings in CLI output"
|
|
529
|
+
},
|
|
530
|
+
"blocking": {
|
|
531
|
+
"type": "string",
|
|
532
|
+
"enum": [
|
|
533
|
+
"error",
|
|
534
|
+
"warning",
|
|
535
|
+
"none"
|
|
536
|
+
],
|
|
537
|
+
"description": "Minimum severity that fails the CLI exit gate"
|
|
538
|
+
},
|
|
539
|
+
"warnings": {
|
|
540
|
+
"type": "boolean",
|
|
541
|
+
"description": "Include warning findings in CLI output"
|
|
542
|
+
},
|
|
543
|
+
"respectInlineDisables": {
|
|
544
|
+
"type": "boolean",
|
|
545
|
+
"description": "Honor inline suppression comments"
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
}
|