#1

React Review Audit

Openreact-doctor[bot]opened 6mo ago

Score: 96/100 · 1 error · 8 warnings

Copy as prompt
Fix the following React Review diagnostics in my codebase.

## Errors (1)

1. [error] effect-needs-cleanup — src/hooks/useScanner.ts:30
   useEffect schedules `setTimeout(...)` but never returns a cleanup — leaks the registration on every re-run and on unmount. Return a cleanup function that calls clearTimeout(...)

## Warnings (8)

2. [warning] async-await-in-loop — src/scanner/index.ts:96
   await inside a while-loop runs the calls sequentially — for independent operations, collect them and use `await Promise.all(items.map(...))` to run them concurrently

3. [warning] async-await-in-loop — src/scanner/index.ts:178
   await inside a while-loop runs the calls sequentially — for independent operations, collect them and use `await Promise.all(items.map(...))` to run them concurrently

4. [warning] async-await-in-loop — src/scanner/index.ts:189
   await inside a for…of loop runs the calls sequentially — for independent operations, collect them and use `await Promise.all(items.map(...))` to run them concurrently

5. [warning] no-barrel-import — src/hooks/useScanner.ts:2
   Import from barrel/index file — import directly from the source module for better tree-shaking

6. [warning] no-cascading-set-state — src/hooks/useScanner.ts:30
   5 setState calls in a single useEffect — consider using useReducer or deriving state

7. [warning] design-no-three-period-ellipsis — src/components/MainView.tsx:66
   Three-period ellipsis ("...") in JSX text — use the actual ellipsis character "…" (or `…`)

8. [warning] design-no-three-period-ellipsis — src/components/MainView.tsx:67
   Three-period ellipsis ("...") in JSX text — use the actual ellipsis character "…" (or `…`)

9. [warning] design-no-three-period-ellipsis — src/components/MainView.tsx:103
   Three-period ellipsis ("...") in JSX text — use the actual ellipsis character "…" (or `…`)

❌ Errors (1)

effect-needs-cleanup

useEffect schedules setTimeout(...) but never returns a cleanup — leaks the registration on every re-run and on unmount. Return a cleanup function that calls clearTimeout(...)

Return a cleanup function that releases the subscription / timer: return () => target.removeEventListener(name, handler) for listeners, return () => clearInterval(id) / clearTimeout(id) for timers, or return unsubscribe if the subscribe call already returned one

src/hooks/useScanner.ts:30


⚠️ Warnings (8)

async-await-in-loop

await inside a while-loop runs the calls sequentially — for independent operations, collect them and use await Promise.all(items.map(...)) to run them concurrently

Collect the items and use await Promise.all(items.map(...)) to run independent operations concurrently

src/scanner/index.ts:96
src/scanner/index.ts:178
src/scanner/index.ts:189

design-no-three-period-ellipsis

Three-period ellipsis ("...") in JSX text — use the actual ellipsis character "…" (or …)

Use the typographic ellipsis "…" (or …) instead of three periods — pairs with action-with-followup labels ("Rename…", "Loading…")

src/components/MainView.tsx:66
src/components/MainView.tsx:67
src/components/MainView.tsx:103

no-barrel-import

Import from barrel/index file — import directly from the source module for better tree-shaking

Import from the direct path: import { Button } from './components/Button' instead of ./components

src/hooks/useScanner.ts:2

no-cascading-set-state

5 setState calls in a single useEffect — consider using useReducer or deriving state

Combine into useReducer: const [state, dispatch] = useReducer(reducer, initialState)

src/hooks/useScanner.ts:30


Last scored May 14, 2026 at 7:35 AM UTC. Maintained by React Review.

Activity

0

No activity yet.