@tsconfig/next

A base TSConfig for working with Next.js.

Usage no npm install needed!

<script type="module">
  import tsconfigNext from 'https://cdn.skypack.dev/@tsconfig/next';
</script>

README

A base TSConfig for working with Next.js.

Add the package to your "devDependencies":

npm install --save-dev @tsconfig/next
yarn add --dev @tsconfig/next

Add to your tsconfig.json:

"extends": "@tsconfig/next/tsconfig.json"

The tsconfig.json:

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "Next.js",
  "compilerOptions": {
    "target": "es5",
    "lib": ["dom", "dom.iterable", "esnext"],
    "allowJs": true,
    "skipLibCheck": true,
    "strict": false,
    "forceConsistentCasingInFileNames": true,
    "noEmit": true,
    "incremental": true,
    "esModuleInterop": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "jsx": "preserve"
  }
}

You can find the code here.