Fix the following React Review diagnostics in my codebase.
## Warnings (110)
1. [warning] label-has-associated-control — src/components/GlobalVarForm.tsx:50
A form label must be associated with a control — use `htmlFor` or nest the input.
2. [warning] control-has-associated-label — src/components/GlobalVarForm.tsx:51
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
3. [warning] label-has-associated-control — src/components/GlobalVarForm.tsx:60
A form label must be associated with a control — use `htmlFor` or nest the input.
4. [warning] control-has-associated-label — src/components/GlobalVarForm.tsx:61
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
5. [warning] button-has-type — src/components/GlobalVarForm.tsx:79
`<button>` elements must have an explicit `type` attribute.
6. [warning] button-has-type — src/components/GlobalVarForm.tsx:82
`<button>` elements must have an explicit `type` attribute.
7. [warning] button-has-type — src/components/GlobalVarForm.tsx:85
`<button>` elements must have an explicit `type` attribute.
8. [warning] js-tosorted-immutable — src/utils/fuzzy.ts:41
[...array].sort() — use array.toSorted() for immutable sorting (ES2023)
9. [warning] js-set-map-lookups — src/utils/fuzzy.ts:52
array.includes() in a loop is O(n) per call — convert to a Set for O(1) lookups
10. [warning] prefer-useReducer — src/components/ScriptRunner.tsx:34
Component "ScriptRunner" has 8 useState calls — consider useReducer for related state
11. [warning] button-has-type — src/components/ScriptRunner.tsx:111
`<button>` elements must have an explicit `type` attribute.
12. [warning] button-has-type — src/components/ScriptRunner.tsx:116
`<button>` elements must have an explicit `type` attribute.
13. [warning] button-has-type — src/components/ScriptRunner.tsx:126
`<button>` elements must have an explicit `type` attribute.
14. [warning] button-has-type — src/components/ScriptRunner.tsx:136
`<button>` elements must have an explicit `type` attribute.
15. [warning] no-array-index-key — src/components/ScriptRunner.tsx:144
Array index in `key` doesn't uniquely identify the element — re-renders may use stale state.
16. [warning] no-array-index-as-key — src/components/ScriptRunner.tsx:144
Array index "i" used as key — causes bugs when list is reordered or filtered
17. [warning] control-has-associated-label — src/components/ScriptRunner.tsx:146
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
18. [warning] button-has-type — src/components/ScriptRunner.tsx:152
`<button>` elements must have an explicit `type` attribute.
19. [warning] button-has-type — src/components/ScriptRunner.tsx:176
`<button>` elements must have an explicit `type` attribute.
20. [warning] button-has-type — src/components/ScriptRunner.tsx:186
`<button>` elements must have an explicit `type` attribute.
21. [warning] button-has-type — src/components/ScriptRunner.tsx:197
`<button>` elements must have an explicit `type` attribute.
22. [warning] button-has-type — src/components/ScriptRunner.tsx:203
`<button>` elements must have an explicit `type` attribute.
23. [warning] button-has-type — src/components/ScriptRunner.tsx:210
`<button>` elements must have an explicit `type` attribute.
24. [warning] no-array-index-key — src/components/ScriptRunner.tsx:211
Array index in `key` doesn't uniquely identify the element — re-renders may use stale state.
25. [warning] no-array-index-as-key — src/components/ScriptRunner.tsx:211
Array index "i" used as key — causes bugs when list is reordered or filtered
26. [warning] no-giant-component — src/components/SettingsView.tsx:11
Component "SettingsView" is 314 lines — consider breaking it into smaller focused components
27. [warning] prefer-useReducer — src/components/SettingsView.tsx:11
Component "SettingsView" has 9 useState calls — consider useReducer for related state
28. [warning] no-cascading-set-state — src/components/SettingsView.tsx:66
4 setState calls in a single useEffect — consider using useReducer or deriving state
29. [warning] exhaustive-deps — src/components/SettingsView.tsx:89
The ref value `saveTimer.current` will likely have changed by the time this effect cleanup function runs. Copy it to a variable inside the hook callback and use that variable in cleanup.
30. [warning] control-has-associated-label — src/components/SettingsView.tsx:176
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
31. [warning] button-has-type — src/components/SettingsView.tsx:176
`<button>` elements must have an explicit `type` attribute.
32. [warning] button-has-type — src/components/SettingsView.tsx:198
`<button>` elements must have an explicit `type` attribute.
33. [warning] control-has-associated-label — src/components/SettingsView.tsx:201
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
34. [warning] button-has-type — src/components/SettingsView.tsx:210
`<button>` elements must have an explicit `type` attribute.
35. [warning] control-has-associated-label — src/components/SettingsView.tsx:213
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
36. [warning] control-has-associated-label — src/components/SettingsView.tsx:235
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
37. [warning] button-has-type — src/components/SettingsView.tsx:264
`<button>` elements must have an explicit `type` attribute.
38. [warning] button-has-type — src/components/SettingsView.tsx:286
`<button>` elements must have an explicit `type` attribute.
39. [warning] button-has-type — src/components/SettingsView.tsx:307
`<button>` elements must have an explicit `type` attribute.
40. [warning] button-has-type — src/components/SettingsView.tsx:344
`<button>` elements must have an explicit `type` attribute.
41. [warning] button-has-type — src/components/SettingsView.tsx:351
`<button>` elements must have an explicit `type` attribute.
42. [warning] button-has-type — src/components/Sidebar.tsx:78
`<button>` elements must have an explicit `type` attribute.
43. [warning] button-has-type — src/components/Sidebar.tsx:89
`<button>` elements must have an explicit `type` attribute.
44. [warning] button-has-type — src/components/Sidebar.tsx:98
`<button>` elements must have an explicit `type` attribute.
45. [warning] button-has-type — src/components/Sidebar.tsx:107
`<button>` elements must have an explicit `type` attribute.
46. [warning] button-has-type — src/components/Sidebar.tsx:115
`<button>` elements must have an explicit `type` attribute.
47. [warning] button-has-type — src/components/Sidebar.tsx:123
`<button>` elements must have an explicit `type` attribute.
48. [warning] button-has-type — src/components/Sidebar.tsx:131
`<button>` elements must have an explicit `type` attribute.
49. [warning] click-events-have-key-events — src/components/Sidebar.tsx:142
Visible non-interactive elements with click handlers must have a corresponding keyboard listener (`onKeyUp`, `onKeyDown`, or `onKeyPress`).
50. [warning] no-static-element-interactions — src/components/Sidebar.tsx:142
Static HTML elements with event handlers require a role — add `role="…"` or use a semantic HTML element instead.
51. [warning] click-events-have-key-events — src/components/Sidebar.tsx:156
Visible non-interactive elements with click handlers must have a corresponding keyboard listener (`onKeyUp`, `onKeyDown`, or `onKeyPress`).
52. [warning] no-static-element-interactions — src/components/Sidebar.tsx:156
Static HTML elements with event handlers require a role — add `role="…"` or use a semantic HTML element instead.
53. [warning] button-has-type — src/components/Sidebar.tsx:161
`<button>` elements must have an explicit `type` attribute.
54. [warning] button-has-type — src/components/Sidebar.tsx:165
`<button>` elements must have an explicit `type` attribute.
55. [warning] button-has-type — src/components/Sidebar.tsx:169
`<button>` elements must have an explicit `type` attribute.
56. [warning] js-flatmap-filter — src/index.tsx:98
.map().filter(Boolean) iterates twice — use .flatMap() to transform and filter in a single pass
57. [warning] button-has-type — src/index.tsx:133
`<button>` elements must have an explicit `type` attribute.
58. [warning] control-has-associated-label — src/index.tsx:157
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
59. [warning] button-has-type — src/index.tsx:165
`<button>` elements must have an explicit `type` attribute.
60. [warning] button-has-type — src/index.tsx:242
`<button>` elements must have an explicit `type` attribute.
61. [warning] button-has-type — src/index.tsx:292
`<button>` elements must have an explicit `type` attribute.
62. [warning] button-has-type — src/index.tsx:298
`<button>` elements must have an explicit `type` attribute.
63. [warning] button-has-type — src/index.tsx:301
`<button>` elements must have an explicit `type` attribute.
64. [warning] button-has-type — src/index.tsx:348
`<button>` elements must have an explicit `type` attribute.
65. [warning] button-has-type — src/index.tsx:379
`<button>` elements must have an explicit `type` attribute.
66. [warning] button-has-type — src/index.tsx:385
`<button>` elements must have an explicit `type` attribute.
67. [warning] button-has-type — src/index.tsx:388
`<button>` elements must have an explicit `type` attribute.
68. [warning] prefer-useReducer — src/components/PackagesView.tsx:10
Component "PackagesView" has 5 useState calls — consider useReducer for related state
69. [warning] no-derived-state — src/components/PackagesView.tsx:30
Avoid storing derived state. "packages" is only set here, and thus could be computed directly during render.
70. [warning] design-no-three-period-ellipsis — src/components/PackagesView.tsx:73
Three-period ellipsis ("...") in JSX text — use the actual ellipsis character "…" (or `…`)
71. [warning] control-has-associated-label — src/components/PackagesView.tsx:85
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
72. [warning] button-has-type — src/components/PackagesView.tsx:93
`<button>` elements must have an explicit `type` attribute.
73. [warning] click-events-have-key-events — src/components/PackagesView.tsx:107
Visible non-interactive elements with click handlers must have a corresponding keyboard listener (`onKeyUp`, `onKeyDown`, or `onKeyPress`).
74. [warning] no-static-element-interactions — src/components/PackagesView.tsx:107
Static HTML elements with event handlers require a role — add `role="…"` or use a semantic HTML element instead.
75. [warning] button-has-type — src/components/PackagesView.tsx:128
`<button>` elements must have an explicit `type` attribute.
76. [warning] button-has-type — src/components/PackagesView.tsx:133
`<button>` elements must have an explicit `type` attribute.
77. [warning] no-derived-state — src/components/PackagesView.tsx:167
Avoid storing derived state. Compute "installed" directly during render, optionally with `useMemo` if it's expensive.
78. [warning] design-no-three-period-ellipsis — src/components/PackagesView.tsx:189
Three-period ellipsis ("...") in JSX text — use the actual ellipsis character "…" (or `…`)
79. [warning] button-has-type — src/components/PackagesView.tsx:196
`<button>` elements must have an explicit `type` attribute.
80. [warning] button-has-type — src/components/PackagesView.tsx:205
`<button>` elements must have an explicit `type` attribute.
81. [warning] button-has-type — src/components/PackagesView.tsx:210
`<button>` elements must have an explicit `type` attribute.
82. [warning] no-array-index-key — src/components/PackagesView.tsx:227
Array index in `key` doesn't uniquely identify the element — re-renders may use stale state.
83. [warning] no-array-index-as-key — src/components/PackagesView.tsx:227
Array index "i" used as key — causes bugs when list is reordered or filtered
84. [warning] prefer-useReducer — src/components/TriggerForm.tsx:15
Component "TriggerForm" has 7 useState calls — consider useReducer for related state
85. [warning] button-has-type — src/components/TriggerForm.tsx:85
`<button>` elements must have an explicit `type` attribute.
86. [warning] label-has-associated-control — src/components/TriggerForm.tsx:91
A form label must be associated with a control — use `htmlFor` or nest the input.
87. [warning] control-has-associated-label — src/components/TriggerForm.tsx:92
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
88. [warning] label-has-associated-control — src/components/TriggerForm.tsx:101
A form label must be associated with a control — use `htmlFor` or nest the input.
89. [warning] control-has-associated-label — src/components/TriggerForm.tsx:103
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
90. [warning] button-has-type — src/components/TriggerForm.tsx:121
`<button>` elements must have an explicit `type` attribute.
91. [warning] label-has-associated-control — src/components/TriggerForm.tsx:137
A form label must be associated with a control — use `htmlFor` or nest the input.
92. [warning] control-has-associated-label — src/components/TriggerForm.tsx:138
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
93. [warning] control-has-associated-label — src/components/TriggerForm.tsx:150
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
94. [warning] button-has-type — src/components/TriggerForm.tsx:164
`<button>` elements must have an explicit `type` attribute.
95. [warning] button-has-type — src/components/TriggerForm.tsx:167
`<button>` elements must have an explicit `type` attribute.
96. [warning] js-set-map-lookups — src/components/CodeEditor.tsx:93
array.indexOf() in a loop is O(n) per call — convert to a Set for O(1) lookups
97. [warning] no-danger — src/components/CodeEditor.tsx:296
Do not use `dangerouslySetInnerHTML` — it injects raw HTML and is a common XSS vector.
98. [warning] control-has-associated-label — src/components/CodeEditor.tsx:298
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
99. [warning] button-has-type — src/components/ScriptLangView.tsx:174
`<button>` elements must have an explicit `type` attribute.
100. [warning] no-array-index-as-key — src/components/ScriptLangView.tsx:179
Array index "i" used as key — causes bugs when list is reordered or filtered
101. [warning] no-array-index-key — src/components/ScriptLangView.tsx:181
Array index in `key` doesn't uniquely identify the element — re-renders may use stale state.
102. [warning] no-initialize-state — src/components/ScriptLangView.tsx:221
Avoid initializing state in an effect. Instead, initialize "activeSection"'s `useState()` with "undefined". For SSR hydration, prefer `useSyncExternalStore()`.
103. [warning] control-has-associated-label — src/components/ScriptLangView.tsx:252
A control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`.
104. [warning] button-has-type — src/components/ScriptLangView.tsx:260
`<button>` elements must have an explicit `type` attribute.
105. [warning] button-has-type — src/components/ScriptLangView.tsx:267
`<button>` elements must have an explicit `type` attribute.
106. [warning] no-array-index-key — src/components/ScriptLangView.tsx:300
Array index in `key` doesn't uniquely identify the element — re-renders may use stale state.
107. [warning] no-array-index-as-key — src/components/ScriptLangView.tsx:300
Array index "i" used as key — causes bugs when list is reordered or filtered
108. [warning] unused-dependency — package.json:0
Unused dependency: `@codemirror/basic-setup`
109. [warning] unused-dependency — package.json:0
Unused dependency: `@codemirror/lang-javascript`
110. [warning] unused-dependency — package.json:0
Unused dependency: `@codemirror/theme-one-dark`
Copy as prompt
`<button>` elements must have an explicit `type` attribute. · 54 in 8 files
button-has-typesrc/components/ScriptRunner.tsxsrc/components/Sidebar.tsxsrc/index.tsxsrc/components/SettingsView.tsxsrc/components/PackagesView.tsxA control must be associated with a text label — add visible text, `aria-label`, or `aria-labelledby`. · 15 in 8 files
control-has-associated-labelsrc/components/SettingsView.tsxsrc/components/TriggerForm.tsxsrc/components/GlobalVarForm.tsxsrc/components/ScriptRunner.tsxsrc/index.tsxA form label must be associated with a control — use `htmlFor` or nest the input. · 5 in 2 files
label-has-associated-controlsrc/components/TriggerForm.tsxsrc/components/GlobalVarForm.tsxArray index in `key` doesn't uniquely identify the element — re-renders may use stale state. · 5 in 3 files
no-array-index-keysrc/components/ScriptRunner.tsxsrc/components/ScriptLangView.tsxsrc/components/PackagesView.tsxArray index "i" used as key — causes bugs when list is reordered or filtered · 5 in 3 files
no-array-index-as-keysrc/components/ScriptRunner.tsxsrc/components/ScriptLangView.tsxsrc/components/PackagesView.tsxComponent "ScriptRunner" has 8 useState calls — consider useReducer for related state · 4 in 4 files
prefer-useReducersrc/components/ScriptRunner.tsxsrc/components/SettingsView.tsxsrc/components/PackagesView.tsxsrc/components/TriggerForm.tsxVisible non-interactive elements with click handlers must have a corresponding keyboard listener (`onKeyUp`, `onKeyDown`, or `onKeyPress`). · 3 in 2 files
click-events-have-key-eventssrc/components/Sidebar.tsxsrc/components/PackagesView.tsxStatic HTML elements with event handlers require a role — add `role="…"` or use a semantic HTML element instead. · 3 in 2 files
no-static-element-interactionssrc/components/Sidebar.tsxsrc/components/PackagesView.tsxUnused dependency: `@codemirror/basic-setup` · 3 in 1 file
unused-dependencypackage.jsonarray.includes() in a loop is O(n) per call — convert to a Set for O(1) lookups · 2 in 2 files
js-set-map-lookupssrc/utils/fuzzy.tssrc/components/CodeEditor.tsxAvoid storing derived state. "packages" is only set here, and thus could be computed directly during render. · 2 in 1 file
no-derived-statesrc/components/PackagesView.tsxThree-period ellipsis ("...") in JSX text — use the actual ellipsis character "…" (or `…`) · 2 in 1 file
design-no-three-period-ellipsissrc/components/PackagesView.tsx[...array].sort() — use array.toSorted() for immutable sorting (ES2023) · 1 in 1 file
js-tosorted-immutablesrc/utils/fuzzy.tsComponent "SettingsView" is 314 lines — consider breaking it into smaller focused components · 1 in 1 file
no-giant-componentsrc/components/SettingsView.tsx4 setState calls in a single useEffect — consider using useReducer or deriving state · 1 in 1 file
no-cascading-set-statesrc/components/SettingsView.tsxThe ref value `saveTimer.current` will likely have changed by the time this effect cleanup function runs. Copy it to a variable inside the hook callback and use that variable in cleanup. · 1 in 1 file
exhaustive-depssrc/components/SettingsView.tsx.map().filter(Boolean) iterates twice — use .flatMap() to transform and filter in a single pass · 1 in 1 file
js-flatmap-filtersrc/index.tsxDo not use `dangerouslySetInnerHTML` — it injects raw HTML and is a common XSS vector. · 1 in 1 file
no-dangersrc/components/CodeEditor.tsxAvoid initializing state in an effect. Instead, initialize "activeSection"'s `useState()` with "undefined". For SSR hydration, prefer `useSyncExternalStore()`. · 1 in 1 file
no-initialize-statesrc/components/ScriptLangView.tsxReviewed by reactreview for commit a2de2f8. Configure here.