Install and use @tsconfig/next
mainInstall the TypeScript configuration tuned for Next.js.
Installation:
npm install --save-dev @tsconfig/next
yarn add --dev @tsconfig/nextUsage:
Add the following to your tsconfig.json:
"extends": "@tsconfig/next/tsconfig.json"