import tseslint from "typescript-eslint"; const PROVIDER_IDS = "youtube|facebook|instagram|threads|linkedin|mastodon|bluesky|reddit|tiktok|twitch|peertube|discord|slack|telegram"; /** Provider branching belongs in connector packages only — never in core/app code. */ const noProviderBranching = { files: ["**/*.ts", "**/*.tsx"], ignores: [ "packages/connector-*/**", "packages/testing/**", // apps/web/src/lib is the mock-registry boundary: manifest-shaped data that // stands in for ConnectorRegistry until the real registry feeds the UI — // same standing as packages/testing. Pages must import from here, never // declare provider literals inline. "apps/web/src/lib/**", "**/*.test.ts", ], rules: { "no-restricted-syntax": [ "error", { selector: `Literal[value=/${PROVIDER_IDS}/]`, message: "Provider string literal outside a connector package — resolve via ConnectorRegistry instead of branching on provider names.", }, ], }, }; export default tseslint.config( { ignores: ["**/dist/**", "**/.next/**", "**/*.config.mjs"] }, ...tseslint.configs.recommended.map((config) => ({ ...config, files: ["**/*.ts", "**/*.tsx"], })), { files: ["**/*.ts", "**/*.tsx"], rules: { "@typescript-eslint/no-explicit-any": "error", "@typescript-eslint/no-unused-vars": [ "error", { argsIgnorePattern: "^_" }, ], }, }, noProviderBranching, );