Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

5.4 KB
Raw Blame
{
    "compilerOptions": {
        "paths": {
            "lib/*": ["./frontend/src/lib/*"],
            "scenes/*": ["./frontend/src/scenes/*"],
            "@posthog/lemon-ui": ["./frontend/@posthog/lemon-ui/src/index"],
            "@posthog/lemon-ui/*": ["./frontend/@posthog/lemon-ui/src/*"],
            "@posthog/icons": ["./frontend/node_modules/@posthog/icons"],
            "@posthog/shared-onboarding/*": ["./docs/onboarding/*"],
            "storybook/*": ["./.storybook/*"],
            "~/*": ["./frontend/src/*"],
            "public/*": ["./frontend/public/*"],
            "products/*": ["./products/*"],
            "@playwright-utils": ["./playwright/utils/index"],
            "@playwright-utils/*": ["./playwright/utils/*"],
            "@playwright-pages/*": ["./playwright/page-models/*"],
            "@playwright-mocks/*": ["./playwright/mocks/*"],
            "@common/*": ["./common/*"],
            "@posthog/mcp-ui": ["./services/mcp/src/ui-apps/lib/index.ts"],
            "@posthog/mcp-ui/*": ["./services/mcp/src/ui-apps/lib/*"],
            "@posthog/replay-shared": ["./common/replay-shared/src/index.ts"],
            "@posthog/replay-shared/*": ["./common/replay-shared/src/*"],
            "@posthog/llm-normalizer": ["./packages/llm-normalizer/src/index.ts"],
            "@posthog/llm-normalizer/*": ["./packages/llm-normalizer/src/*"],
            "@posthog/agent-contracts/*": ["./packages/agent/packages/agent-contracts/src/*"],
            // The published @posthog/quill dist inlines a copy of @posthog/quill-primitives, and app code
            // also imports the primitives package directly. Resolving the umbrella to its re-export source
            // makes both import paths share the one primitives build.
            "@posthog/quill": ["./packages/quill/packages/quill/src/index.ts"],
            "@posthog/quill-charts": ["./packages/quill/packages/charts/src/index.ts"],
            "@posthog/quill-charts/*": ["./packages/quill/packages/charts/src/*"],
            // These packages are installed under frontend/node_modules only, which product
            // files (products/*/frontend) can't reach by walking up from their own directory.
            "@storybook/react": ["./frontend/node_modules/@storybook/react/dist/index.d.ts"],
            "storybook/preview-api": ["./frontend/node_modules/storybook/dist/preview-api/index.d.ts"],
            "storybook/test": ["./frontend/node_modules/storybook/dist/test/index.d.ts"],
            "react-dom/server": ["./frontend/node_modules/@types/react-dom/server.d.ts"],
            "@tiptap/*": ["./frontend/node_modules/@tiptap/*"],
            // Needed to access the subpath since torph didn't set up types properly
            "torph/react": ["./frontend/node_modules/torph/dist/react/index"],
            // [email protected] only exposes types under `node`/`browser` conditions,
            // which TS bundler resolution doesn't activate. Point at the .d.ts directly.
            "use-debounce": ["./frontend/node_modules/use-debounce/dist/index"],
            "*": ["./frontend/*"]
        },
        // https://www.sitepoint.com/react-with-typescript-best-practices/
        "allowJs": true, // Allow JavaScript files to be compiled
        "skipLibCheck": true, // Skip type checking of all declaration files
        "esModuleInterop": true, // Disables namespace imports (import * as fs from "fs") and enables CJS style imports (import fs from "fs")
        "allowSyntheticDefaultImports": true, // Allow default imports from modules with no default export
        "strict": true, // Enable all strict type checking options
        "forceConsistentCasingInFileNames": true, // Disallow inconsistently-cased references to the same file.
        "module": "esnext", // Specify module code generation
        "moduleResolution": "bundler", // Frontend is bundled (esbuild); pairs with module: esnext
        "isolatedModules": true,
        "incremental": true,
        "resolveJsonModule": true, // Include modules imported with .json extension
        "noEmit": true, // Do not emit output (meaning do not compile code, only perform type checking)
        "jsx": "react-jsx", // Support JSX in .tsx files
        "target": "es2021",
        "sourceMap": true, // Generate corrresponding .map file
        "declaration": true, // Generate corresponding .d.ts file
        "noUnusedLocals": true, // Report errors on unused locals
        "noUnusedParameters": true, // Report errors on unused parameters
        "noImplicitOverride": true, // Require the `override` modifier when overriding a base class member
        "allowUnreachableCode": false, // Raise errors on unreachable code
        "allowUnusedLabels": false, // Raise errors on unused labels
        "experimentalDecorators": true, // Enables experimental support for ES decorators
        "noFallthroughCasesInSwitch": true, // Report errors for fallthrough cases in switch statement
        "lib": ["dom", "es2023"]
    },
    "include": [
        "frontend/**/*",
        ".storybook/**/*",
        "playwright/**/*",
        "products/**/frontend/**/*",
        "products/**/manifest.tsx",
        "common/esbuilder/*",
        "common/replay-shared/src/**/*",
        "common/storybook/*",
        "docs/onboarding/**/*",
        "packages/quill/packages/charts/src/**/*",
        "packages/llm-normalizer/src/**/*"
    ],
    "exclude": ["frontend/dist/**/*", "**/*.mdx"],
    "ts-node": {
        "compilerOptions": {
            "module": "commonjs"
        }
    }
}