{
  "$schema": "https://json.schemastore.org/tsconfig",
  "compilerOptions": {
    /* -------------------------------------------------------------------------
     * Language & Environment
     * ---------------------------------------------------------------------- */
    "target": "ES2022",
    "lib": ["dom", "dom.iterable", "ES2022"],
    "jsx": "preserve",

    /* -------------------------------------------------------------------------
     * Module Resolution
     * ---------------------------------------------------------------------- */
    "module": "ESNext",
    "moduleResolution": "bundler",
    "moduleDetection": "force",
    "resolveJsonModule": true,
    "allowJs": true,
    "customConditions": ["types"],

    /* -------------------------------------------------------------------------
     * Emit
     * ---------------------------------------------------------------------- */
    "noEmit": true,
    "incremental": true,

    /* -------------------------------------------------------------------------
     * Type Checking — Strict Mode
     * ---------------------------------------------------------------------- */
    "strict": true,
    "noUncheckedIndexedAccess": true,
    "noImplicitOverride": true,
    "noFallthroughCasesInSwitch": true,
    "exactOptionalPropertyTypes": false,

    /* -------------------------------------------------------------------------
     * Interop
     * ---------------------------------------------------------------------- */
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "forceConsistentCasingInFileNames": true,
    "isolatedModules": true,

    /* -------------------------------------------------------------------------
     * Plugins (Next.js)
     * ---------------------------------------------------------------------- */
    "plugins": [
      {
        "name": "next"
      }
    ],

    /* -------------------------------------------------------------------------
     * Path Aliases
     * All @/ imports resolve to src/
     * ---------------------------------------------------------------------- */
    "baseUrl": ".",
    "paths": {
      /* Root alias — maps @/ to src/ */
      "@/*": ["./src/*"],

      /* ── App ── */
      "@/app/*": ["./src/app/*"],

      /* ── Components ── */
      "@/components/*": ["./src/components/*"],
      "@/components/ui/*": ["./src/components/ui/*"],
      "@/components/layout/*": ["./src/components/layout/*"],
      "@/components/forms/*": ["./src/components/forms/*"],
      "@/components/charts/*": ["./src/components/charts/*"],
      "@/components/modals/*": ["./src/components/modals/*"],
      "@/components/shared/*": ["./src/components/shared/*"],

      /* ── Library / utilities ── */
      "@/lib/*": ["./src/lib/*"],
      "@/lib/api": ["./src/lib/api.ts"],
      "@/lib/utils": ["./src/lib/utils.ts"],

      /* ── Hooks ── */
      "@/hooks/*": ["./src/hooks/*"],

      /* ── State stores (Zustand) ── */
      "@/store/*": ["./src/store/*"],
      "@/store/authStore": ["./src/store/authStore.ts"],
      "@/store/workspaceStore": ["./src/store/workspaceStore.ts"],

      /* ── Types ── */
      "@/types/*": ["./src/types/*"],
      "@/types": ["./src/types/index.ts"],

      /* ── Constants ── */
      "@/constants/*": ["./src/constants/*"],
      "@/constants": ["./src/constants/index.ts"],

      /* ── Styles ── */
      "@/styles/*": ["./src/styles/*"],

      /* ── Config files ── */
      "@/config/*": ["./src/config/*"],
      "@/config": ["./src/config/index.ts"]
    }
  },

  /* ---------------------------------------------------------------------------
   * Files to include
   * -------------------------------------------------------------------------- */
  "include": [
    "next-env.d.ts",
    "**/*.ts",
    "**/*.tsx",
    "**/*.mts",
    "**/*.cts",
    ".next/types/**/*.ts"
  ],

  /* ---------------------------------------------------------------------------
   * Files & directories to exclude
   * -------------------------------------------------------------------------- */
  "exclude": [
    "node_modules",
    ".next",
    "out",
    "dist",
    "build",
    "coverage",
    "**/*.spec.ts",
    "**/*.spec.tsx",
    "**/*.test.ts",
    "**/*.test.tsx"
  ]
}