{
  "$schema": "https://json.schemastore.org/tsconfig",
  "include": [
    "${configDir}/*.ts",
    "${configDir}/src/**/*.ts",
    "${configDir}/scripts/**/*.ts",
    // TODO: Keep one of these:
    "${configDir}/test/**/*.ts",
    "${configDir}/tests/**/*.ts",
    "${configDir}/data/**/*.json",
    "${configDir}/package.json"
  ],
  "exclude": ["${configDir}/src/**/*.pkg/**/*"],
  "compilerOptions": {
    // Resolve
    "rootDir": "${configDir}",
    "paths": {},
    // Output
    "target": "esnext",
    "outDir": "${configDir}/.ts",
    "tsBuildInfoFile": "${configDir}/.ts/tsconfig.tsbuildinfo",
    "emitDeclarationOnly": true,
    // Modules
    "module": "nodenext",
    "moduleResolution": "nodenext",
    "isolatedModules": true,
    "moduleDetection": "force", // Stop treating files without imports/exports as single global scripts
    "allowImportingTsExtensions": true, // Use .ts extensions to make imports work in Node.js
    "verbatimModuleSyntax": true, // Enforce type-only imports
    "resolveJsonModule": true,
    // Env
    "lib": ["ESNext"],
    // TODO: Enable when we can:
    // "erasableSyntaxOnly": true, // Disallow using using runtime TS features
    // Checks
    "skipLibCheck": true,
    "strict": true,
    // TODO: Enable these when we can:
    // "noUncheckedIndexedAccess": true,
    // "exactOptionalPropertyTypes": true,
    "forceConsistentCasingInFileNames": true,
    "noImplicitOverride": true, // Force using override modifier in classes
    "checkJs": true, // Allow using JSDoc to type check JavaScript files
    // Build
    "incremental": true,
    // Project references
    "composite": true
  }
}
