: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.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
{
"$schema": "./node_modules/oxlint/configuration_schema.json",
"plugins": ["typescript", "unicorn", "react", "react-perf", "jest", "promise", "jsdoc", "oxc", "import"],
"env": {
"builtin": true
},
"ignorePatterns": [
"products/desktop",
"products/mobile",
"packages/agent",
"node_modules",
"dist",
"build",
"rust",
"cli",
"nodejs",
".semgrep",
".github/actions/paths-filter",
".depot/actions/paths-filter",
".github/actions/shared-image-releases",
".github/scripts",
"common/hogvm/typescript",
"common/hogvm/typescript/dist",
"common/plugin_transpiler/dist",
"common/hogvm/__tests__/__snapshots__",
"common/hogvm/__tests__/__snapshots__/**",
"frontend/src/queries/validators.js",
"frontend/src/queries/web-analytics-validators.js",
"frontend/src/generated/**",
"services/mcp/**/generated.ts",
"services/mcp/schema/tool-inputs.json",
"products/**/frontend/generated/**",
"hog/test/parity/bundles/**"
],
"rules": {
"no-constant-condition": "off",
"no-prototype-builtins": "off",
"no-irregular-whitespace": "off",
"require-await": "off",
"no-await-in-loop": "off",
"react/react-in-jsx-scope": "off",
"react/no-unescaped-entities": "off",
"react/jsx-no-target-blank": "off",
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-inferrable-types": "off",
"@typescript-eslint/ban-ts-comment": "off",
"@typescript-eslint/no-explicit-any": "off",
"check-tag-names": "off",
"no-unused-vars": [
"error",
{
"ignoreRestSiblings": true,
"argsIgnorePattern": "^_",
"varsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_"
}
],
"no-useless-spread": "error",
"no-accumulating-spread": "error",
"no-useless-fallback-in-spread": "error",
"react-hooks/exhaustive-deps": "warn",
"no-else-return": "warn",
"react-hooks/rules-of-hooks": "error",
"react/jsx-curly-brace-presence": [
"error",
{
"props": "never",
"children": "never",
"propElementValues": "always"
}
],
"no-console": [
"error",
{
"allow": ["info", "warn", "error"]
}
],
"no-debugger": "error",
"react/self-closing-comp": [
"error",
{
"component": true,
"html": true
}
],
"@typescript-eslint/prefer-ts-expect-error": "error",
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": true
}
],
"curly": "error",
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "dayjs",
"message": "Do not directly import dayjs. Only import the dayjs exported from 'lib/dayjs'."
},
{
"name": "~/queries/schema",
"message": "Import from 'queries/schema/schema-foo' to avoid Webpack/Sucrase enum export issues."
},
{
"name": "monaco-editor",
"message": "Value imports of monaco-editor statically couple ~4 MB of editor code into your chunk. Use `import type`, or render via the lazy facade in lib/monaco/CodeEditor.",
"allowTypeImports": true
},
{
"name": "lib/monaco/CodeEditorImpl",
"message": "Import CodeEditor from lib/monaco/CodeEditor instead — the lazy facade keeps monaco out of your chunk."
},
{
"name": "~/lib/monaco/CodeEditorImpl",
"message": "Import CodeEditor from lib/monaco/CodeEditor instead — the lazy facade keeps monaco out of your chunk."
},
{
"name": "@posthog/brand/hoggies",
"message": "Inline-SVG hoggies bundle up to ~1 MB of JS each. Use the PNG export instead: import * as name from '@posthog/brand/hoggies/png/<name>' and wrap with pngHoggie from lib/brand/hoggies. If you truly need vector output, add an oxlint-disable comment stating why.",
"allowTypeImports": true
},
{
"name": "@posthog/brand/hoggies/svg",
"message": "Inline-SVG hoggies bundle up to ~1 MB of JS each. Use the PNG export instead: import * as name from '@posthog/brand/hoggies/png/<name>' and wrap with pngHoggie from lib/brand/hoggies. If you truly need vector output, add an oxlint-disable comment stating why."
},
{
"name": "@posthog/brand/hoggies/png",
"message": "Import the per-asset stub instead: import * as name from '@posthog/brand/hoggies/png/<name>'. The barrel pulls every hoggie's stub into the graph."
},
{
"name": "storybook/preview-api",
"message": "The withKea decorator renders a story after Storybook clears its hook context, so Storybook preview hooks such as useArgs throw or never fire, and the story renders blank in visual regression runs. Keep story state in React's useState."
},
{
"name": "storybook/test",
"importNames": ["within", "waitFor"],
"message": "Import within and waitFor from @testing-library/dom to use the configured Storybook async timeout."
}
],
"patterns": [
{
"group": ["@posthog/brand/hoggies/svg/*"],
"message": "Inline-SVG hoggies bundle up to ~1 MB of JS each. Use the PNG export instead: import * as name from '@posthog/brand/hoggies/png/<name>' and wrap with pngHoggie from lib/brand/hoggies. If you truly need vector output, add an oxlint-disable comment stating why."
}
]
}
],
"react/forbid-dom-props": [
"warn",
{
"forbid": [
{
"propName": "style",
"message": "style should be avoided in favor of utility CSS classes - see https://storybook.dev.posthog.dev/?path=/docs/lemon-ui-utilities--overview"
}
]
}
],
"no-new-array": "warn",
"react/forbid-elements": [
"error",
{
"forbid": [
{
"element": "Space",
"message": "use flex or space utility classes instead"
},
{
"element": "Spin",
"message": "use Spinner instead"
},
{
"element": "MonacoEditor",
"message": "use <CodeEditor> instead"
},
{
"element": "ReactMarkdown",
"message": "use <LemonMarkdown> instead"
},
{
"element": "a",
"message": "use <Link> instead"
}
]
}
],
"no-constant-binary-expression": "error",
"no-useless-rename": "error",
"no-useless-call": "error",
"import/no-cycle": [
"warn",
{
"maxDepth": 10
}
],
"jest/no-restricted-matchers": [
"error",
{
"toBeDefined": "Do not use .toBeDefined() in tests, use .toBeTruthy() or .not.toBeUndefined() instead."
}
]
},
"overrides": [
{
"files": ["*.stories.tsx"],
"rules": {
"react-hooks/rules-of-hooks": "off"
}
},
{
"files": ["services/mcp/src/generated/**/*.ts"],
"rules": {
"no-useless-escape": "off"
}
},
{
"files": ["services/mcp/src/generated/**/*.ts", "services/mcp/src/tools/generated/**/*.ts"],
"rules": {
"@typescript-eslint/explicit-function-return-type": "off"
}
},
{
"files": ["services/mcp/src/ui-apps/**/*.{ts,tsx}"],
"rules": {
"no-console": [
"error",
{
"allow": ["debug", "info", "warn", "error"]
}
]
}
},
{
"files": ["docs/onboarding/**/*.tsx"],
"rules": {
"react/forbid-elements": "off"
}
},
{
"files": ["services/stripe-app/src/**/*.{ts,tsx}"],
"rules": {
"react/forbid-elements": "off",
"react/forbid-dom-props": "off",
"no-restricted-imports": "off"
}
},
{
"files": [
"services/mcp/src/ui-apps/**/*.{ts,tsx}",
"products/**/mcp/apps/**/*.{ts,tsx}",
"products/tasks/frontend/infrastructure/**/*.{ts,tsx}"
],
"rules": {
"react/forbid-elements": "off"
}
},
{
"files": [
"frontend/src/lib/monaco/**",
"frontend/src/lib/components/MonacoDiffEditor.tsx",
"frontend/src/scenes/data-warehouse/editor/sqlEditorLogic.tsx",
"frontend/src/scenes/hog-functions/configuration/HogFunctionTest.tsx"
],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "dayjs",
"message": "Do not directly import dayjs. Only import the dayjs exported from 'lib/dayjs'."
},
{
"name": "~/queries/schema",
"message": "Import from 'queries/schema/schema-foo' to avoid Webpack/Sucrase enum export issues."
}
]
}
]
}
},
{
"files": ["frontend/src/toolbar/**/*.{ts,tsx}"],
"rules": {
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": [
"scenes/**",
"~/scenes/**",
"!scenes/urls",
"!~/scenes/urls",
"!scenes/product-tours/stepUtils",
"!scenes/product-tours/constants",
"!scenes/product-tours/editor/generateStepHtml"
],
"message": "The toolbar ships to customer pages and must not depend on app scenes. Import from lib/, or fetch via toolbarFetch. The listed exceptions are the toolbar's intentional seams; the full transitive boundary is enforced by frontend/bin/check-toolbar-graph.mjs."
},
{
"group": ["~/products", "products/**", "~/products/**"],
"message": "The toolbar must not import product manifests or product frontends — that pulls the whole product graph into the customer-facing bundle."
},
{
"group": ["layout/**", "~/layout/**", "models/**", "~/models/**"],
"message": "The toolbar must not import app layout or global models."
}
],
"paths": [
{
"name": "lib/api",
"message": "Toolbar code must use toolbarFetch/toolbarApi (authorized via toolbar params), not the app's api client.",
"allowTypeImports": true
},
{
"name": "~/lib/api",
"message": "Toolbar code must use toolbarFetch/toolbarApi (authorized via toolbar params), not the app's api client.",
"allowTypeImports": true
},
{
"name": "dayjs",
"message": "Do not directly import dayjs. Only import the dayjs exported from 'lib/dayjs'."
},
{
"name": "~/queries/schema",
"message": "Import from 'queries/schema/schema-foo' to avoid Webpack/Sucrase enum export issues."
},
{
"name": "monaco-editor",
"message": "Value imports of monaco-editor statically couple ~4 MB of editor code into your chunk. Use `import type`, or render via the lazy facade in lib/monaco/CodeEditor.",
"allowTypeImports": true
},
{
"name": "lib/monaco/CodeEditorImpl",
"message": "Import CodeEditor from lib/monaco/CodeEditor instead — the lazy facade keeps monaco out of your chunk."
},
{
"name": "~/lib/monaco/CodeEditorImpl",
"message": "Import CodeEditor from lib/monaco/CodeEditor instead — the lazy facade keeps monaco out of your chunk."
}
]
}
]
}
},
{
"files": ["products/posthog_ai/frontend/sandbox/**/*.{ts,tsx}"],
"rules": {
"no-restricted-imports": [
"error",
{
"patterns": [
{
"group": ["**/ee/api/conversation", "**/ee/api/conversation/**"],
"message": "Sandbox renderer must not import the conversation API. Use products/tasks/frontend/generated/api for task data."
},
{
"group": ["**/api.conversations*"],
"message": "Sandbox renderer must not import api.conversations. Use api.tasks.* and products/tasks/frontend/generated/api."
}
],
"paths": [
{
"name": "scenes/max/maxThreadLogic",
"message": "Sandbox module must not import maxThreadLogic (conversation orchestration). Forbidden by design boundary."
},
{
"name": "scenes/max/maxContextLogic",
"message": "Sandbox module must not import maxContextLogic. Forbidden by design boundary."
},
{
"name": "scenes/max/maxLogic",
"message": "Sandbox module must not import maxLogic. Forbidden by design boundary."
},
{
"name": "scenes/max/maxGlobalLogic",
"message": "Sandbox module must not import maxGlobalLogic. Forbidden by design boundary."
},
{
"name": "scenes/max/maxTypes",
"message": "Avoid importing maxTypes from the sandbox module. Extract needed types (e.g. SandboxToolCallMessage) into products/posthog_ai/frontend/sandbox/types/ instead.",
"allowTypeImports": true
},
{
"name": "dayjs",
"message": "Do not directly import dayjs. Only import the dayjs exported from 'lib/dayjs'."
},
{
"name": "~/queries/schema",
"message": "Import from 'queries/schema/schema-foo' to avoid Webpack/Sucrase enum export issues."
}
]
}
]
}
},
{
"files": ["frontend/src/lib/components/UniversalFilters/constants.ts"],
"rules": {
"no-restricted-imports": [
"error",
{
"paths": [
{
"name": "~/types",
"allowTypeImports": true,
"message": "constants.ts is a leaf module kept free of ~/types's value-import graph (which circles back through scenes/session-recordings and caused \"Cannot access 'DEFAULT_UNIVERSAL_GROUP_FILTER' before initialization\" TDZ errors). Only `import type` from ~/types is allowed here; import/no-cycle can't catch this because the real cycle is far deeper than its configured maxDepth."
}
]
}
]
}
}
]
}