Reviewing vibe code: a process for AI-generated Node.js and React
AI-generated code (“vibe code”) is now a normal part of shipping Node.js and React projects. The speed is real. So are the risks: bugs, security flaws, and non-idiomatic code that quietly drifts from your project’s standards.
The answer isn’t to stop using it. It’s a structured review process. (This started as a talk: slides here, and as a LinkedIn post.)
Where vibe code goes wrong
Node.js: improper async/await handling or callback hell; unvalidated inputs; vulnerable npm packages the model happily imports.
React: inefficient component rendering, missing key props, state
management errors, outdated hooks usage.
Everywhere: context gaps. The model misses project-specific conventions (your Redux patterns, your Express middleware shape) because it can’t see them.
The five-step review
-
Static analysis. ESLint with
eslint-plugin-nodefor API routes and middleware;eslint-plugin-reactandeslint-plugin-react-hooksfor components. Catch the mechanical issues before a human spends attention. -
Functional review. Test API endpoints with Postman or Jest; verify component behavior, props, and state updates actually do what the prompt asked for.
-
Security check.
npm auditor Snyk over the dependency tree; check dynamic rendering and user inputs for XSS. -
Performance evaluation. Look for event-loop blocking and unoptimized database queries server-side; use React DevTools to catch unnecessary re-renders client-side.
-
Code style. Prettier + ESLint enforcing one consistent style, so generated code is indistinguishable from house code.
A small case study
Vibe code generated a Node.js API route and a React login form. The review
found an unhandled promise rejection in the async route handler and a missing
key prop in a mapped list causing render issues. Fixes: try-catch with
proper error middleware on the route; unique keys and input sanitization on
the form. Secure, performant, maintainable, but only after review.
Practices that make it stick
- Validate inputs with Joi or express-validator; keep secrets in environment variables; unit-test API logic with Jest or Mocha.
- Use hooks correctly, memoize where it matters (
React.memo,useMemo), and test components with React Testing Library. - Run everything through pull requests with human reviewers, and document recurring issues: they’re free training data for better prompts.
The point
Vibe code boosts productivity, but it needs the same bar as human code: automated tools for what machines catch best, human oversight for what they can’t see. The teams that struggle with AI-generated code aren’t the ones using it most. They’re the ones reviewing it least.