// the find
joshwcomeau/new-component
⚛ ⚡ CLI utility for quickly creating new React components. ⚡ ⚛
A CLI tool by Josh Comeau that scaffolds new React components with his preferred file structure — a component file plus a barrel index.js, formatted with Prettier. It's a thin convenience script, not a framework. Aimed at developers who already follow or want to adopt his component organization pattern.
Prettier integration is the right call — generated files match your existing code style without manual cleanup. Config layering (global → local → CLI flags) is sensible and covers the real use cases. TypeScript support landed in v5, so `.tsx` output works out of the box. The source is small enough (one `src/index.js`, two templates) that forking and tweaking is genuinely easy, which matters since the author explicitly says he won't maintain it.
The Next.js App Router incompatibility is a hard blocker for a large chunk of React projects today — the barrel export pattern it generates breaks the App Router, and the fix requires forking. Untested on Windows per the README, which is a gap for a dev tool in 2024. No support for generating co-located test files or CSS modules alongside the component, so the scaffolding stops at the bare minimum. With 759 stars and no active maintainer, this is effectively frozen; if your project's conventions drift from Comeau's, you're forking from day one.