/*
This TSConfig file aims to keep as much as possible in sync with the same file
in Auspice¹.

It can't be 100% the same because Next.js requires some configuration options to
be set and will rewrite this file if they aren't set.²

¹ <https://github.com/nextstrain/auspice/blob/-/tsconfig.json>
² https://github.com/vercel/next.js/discussions/39942
*/

{
  "compilerOptions": {

    /* Modules */
    "moduleResolution": "node",                          /* Specify how TypeScript looks up a file from a given module specifier. */
    "types": ["node"],                                   /* Specify type package names to be included without being referenced in a source file. */

    /* JavaScript Support */
    "allowJs": true,                                     /* Allow JavaScript files to be a part of your program. This allows TS files to import from JS files. */

    /* Emit */
    "noEmit": true,                                      /* Do not emit compiler output files like JavaScript source code, source-maps or declarations. */

    /* Interop Constraints */
    "isolatedModules": true,                             /* Ensure that each file can be safely transpiled without relying on other imports. */
    "allowSyntheticDefaultImports": true,                /* Allow 'import x from y' when a module doesn't have a default export. */
    "forceConsistentCasingInFileNames": true,            /* Ensure that casing is correct in imports. */

    /* Type Checking */
    "strict": true,                                      /* Enable all strict type-checking options. */
    "noImplicitAny": true,                               /* Disable implicit any. */
    "noUnusedLocals": true,                              /* Enable error reporting when a local variables aren't read. */
    "noUnusedParameters": true,                          /* Raise an error when a function parameter isn't read */
    "noImplicitReturns": true,                           /* Enable error reporting for codepaths that do not explicitly return in a function. */
    "noFallthroughCasesInSwitch": true,                  /* Enable error reporting for fallthrough cases in switch statements. */
    "noUncheckedIndexedAccess": true,                    /* Include 'undefined' in index signature results */
    "noImplicitOverride": true,                          /* Ensure overriding members in derived classes are marked with an override modifier. */
    "allowUnusedLabels": false,                          /* Enable error reporting for unused labels. */
    "allowUnreachableCode": false,                       /* Enable error reporting for unreachable code. */

    /* Completeness */
    "skipDefaultLibCheck": true,                         /* Skip type checking .d.ts files that are included with TypeScript. */
    "skipLibCheck": true,                                /* Skip type checking all .d.ts files. */
 
    /* Other options required by Next.js */
    "jsx": "preserve",
    "lib": [
      "dom",
      "dom.iterable",
      "esnext"
    ],
    "incremental": true,
    "esModuleInterop": true,
    "module": "esnext",
    "resolveJsonModule": true,
    "plugins": [
      {
        "name": "next"
      }
    ]
  },
  "include": [
    "app/**/*",
    "content/**/*",
    "data/**/*",
    "components/**/*",
    "pages/**/*",
    "src/**/*",
    "types.d.ts",

    /* For Next.js */
    ".next/types/**/*.ts",
    "next-env.d.ts",
  ],
  "exclude": [
    "node_modules"
  ]
}
