A base TSConfig for working with Next.js + Strictest.
Add the package to your "devDependencies"
:
npm install --save-dev @tsconfig/next-strictest
yarn add --dev @tsconfig/next-strictest
Add to your tsconfig.json
:
"extends": "@tsconfig/next-strictest/tsconfig.json"
The tsconfig.json
:
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "Next.js + Strictest",
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"allowUnusedLabels": false,
"allowUnreachableCode": false,
"exactOptionalPropertyTypes": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"noPropertyAccessFromIndexSignature": true,
"noUncheckedIndexedAccess": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"importsNotUsedAsValues": "error",
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"incremental": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve"
}
}
You can find the code here.