juice-interface
juice-interface copied to clipboard
Improve NextJS dev experience
Description
NextJS doesn't alert devs about type errors while the server is running (yarn dev
). The only way to get it is by running yarn build
.
This effectively means: if there's a bad import (or any other random typescript compile error), it won't be caught until the Vercel preview deployment fails in GitHub CI (as a result of Vercel running yarn build
).
I wonder if there is a better wei.
Link from Jmill
"check-types": "tsc --noemit",
"lint": "npm run check-types && next lint",
adding these steps to the precommit hooks at least ensures it won't get pushed
https://github.com/vercel/next.js/discussions/31439#discussioncomment-1650116