create-react-app icon indicating copy to clipboard operation
create-react-app copied to clipboard

feat(react-scripts): support JSON with comments in jsconfig.json (#7426)

Open DipakHalkude opened this issue 3 months ago • 1 comments

DipakHalkude avatar Sep 23 '25 11:09 DipakHalkude

Problem: jsconfig.json with comments (JSONC) fails to parse in non-TypeScript projects.

Change: In packages/react-scripts/config/modules.js, when jsconfig.json exists: Try to resolve typescript from app node_modules; if available, parse with ts.readConfigFile (supports JSONC). Otherwise, fallback to strict JSON.parse; on failure, show a clear message suggesting to install TypeScript (dev dependency) to enable JSONC support.

Impact: Projects can use comments in jsconfig.json without requiring TypeScript globally; strict JSON still works without extra deps.

DipakHalkude avatar Sep 23 '25 11:09 DipakHalkude