- Delete packages/core-events/ (15 files) - Strip @repo/core-events from all 5 feature package.json + apps/web-next/package.json - Strip @repo/core-events from apps/web-next/next.config.mjs transpilePackages - Strip E1 + J no-restricted-syntax blocks from core-eslint/base.js (anchor remains) - Update bind-production.ts: drop bus construction + IEventBus import; rename resolveEventsAndJobsProduction → resolveJobsProduction (queue only), resolveEventsAndJobsDevSeed → resolveJobsDevSeed (queue only); ctx no longer has bus field; BindProductionContext generic arg narrowed - Update bind-production.test.ts: assert ctx.bus is undefined, drop PayloadJobsEventBus/InMemoryEventBus instanceof checks - Update sign-up-welcome-email.test.ts: assert mailer stays empty without bus - Inline userSignedUpEvent in auth (drop defineEvent import from core-events) - Drop InMemoryEventBus fallback from auth/di/module.ts Feature binders' bus?.subscribe/publish calls remain as no-ops. Scaffold @repo/core-events back via: pnpm turbo gen core-package events Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
119 lines
4.0 KiB
JavaScript
119 lines
4.0 KiB
JavaScript
import js from "@eslint/js";
|
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
import tseslint from "typescript-eslint";
|
|
import turboPlugin from "eslint-plugin-turbo";
|
|
import boundaries from "eslint-plugin-boundaries";
|
|
import globals from "globals";
|
|
// <gen:realtime-rules-imports>
|
|
|
|
export default [
|
|
{ ignores: ["dist/**", "node_modules/**", ".next/**", ".turbo/**", "storybook-static/**"] },
|
|
js.configs.recommended,
|
|
{
|
|
files: ["**/*.{mjs,cjs,js}", "**/*.config.{ts,tsx}"],
|
|
languageOptions: {
|
|
globals: { ...globals.node },
|
|
},
|
|
},
|
|
...tseslint.configs.recommended,
|
|
eslintConfigPrettier,
|
|
{
|
|
plugins: { turbo: turboPlugin },
|
|
rules: {
|
|
"turbo/no-undeclared-env-vars": "warn",
|
|
},
|
|
},
|
|
{
|
|
rules: {
|
|
// Honour the leading-underscore convention for intentionally-unused params/vars.
|
|
"@typescript-eslint/no-unused-vars": [
|
|
"error",
|
|
{
|
|
argsIgnorePattern: "^_",
|
|
varsIgnorePattern: "^_",
|
|
caughtErrorsIgnorePattern: "^_",
|
|
},
|
|
],
|
|
},
|
|
},
|
|
{
|
|
plugins: { boundaries },
|
|
settings: {
|
|
"boundaries/elements": [
|
|
{ type: "app", pattern: "apps/*" },
|
|
{ type: "tooling", pattern: "packages/core-eslint" },
|
|
{ type: "tooling", pattern: "packages/core-typescript" },
|
|
{ type: "tooling", pattern: "packages/core-testing" },
|
|
{ type: "core-composition", pattern: "packages/core-api" },
|
|
{ type: "core-composition", pattern: "packages/core-cms" },
|
|
{ type: "core", pattern: "packages/core-*" },
|
|
{ type: "feature", pattern: "packages/!(core-*)" },
|
|
],
|
|
},
|
|
rules: {
|
|
"boundaries/element-types": [
|
|
2,
|
|
{
|
|
default: "disallow",
|
|
rules: [
|
|
{ from: "app", allow: ["app", "core", "core-composition", "feature", "tooling"] },
|
|
{ from: "feature", allow: ["core", "tooling"] },
|
|
{ from: "core", allow: ["core", "tooling"] },
|
|
{ from: "core-composition", allow: ["core", "feature", "tooling"] },
|
|
{ from: "tooling", allow: ["tooling"] },
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
// R40 — block direct @sentry/* imports outside the allowlisted instrumentation paths
|
|
{
|
|
files: ["**/*.{ts,tsx,mjs,cjs,js}"],
|
|
rules: {
|
|
"no-restricted-imports": [
|
|
"error",
|
|
{
|
|
patterns: [
|
|
{
|
|
group: ["@sentry/*"],
|
|
message:
|
|
"Import from @repo/core-shared/instrumentation instead — feature packages must not depend on Sentry directly (R40).",
|
|
},
|
|
],
|
|
},
|
|
],
|
|
},
|
|
},
|
|
// R40 allowlist — the only paths permitted to import @sentry/*.
|
|
// Patterns are double-star prefixed so they match whether eslint runs from
|
|
// the repo root or from inside a sub-package.
|
|
{
|
|
files: [
|
|
"**/instrumentation/sentry/**",
|
|
"**/instrumentation/di/bind-sentry-instrumentation.{ts,js}",
|
|
"**/instrumentation/di/bind-sentry-instrumentation.test.{ts,js}",
|
|
"**/setup/no-sentry.{ts,js}",
|
|
"**/setup/no-sentry.test.{ts,js}",
|
|
"**/instrumentation.{ts,js,mjs}",
|
|
"**/instrumentation-client.{ts,js,mjs}",
|
|
"**/next.config.{mjs,ts,js}",
|
|
"**/vite.config.{ts,mjs,js}",
|
|
"**/sentry.*.config.{ts,mjs,js}",
|
|
],
|
|
rules: {
|
|
"no-restricted-imports": "off",
|
|
},
|
|
},
|
|
// E1 — Event handlers must not be re-exported. Wire them only inside the
|
|
// consumer feature's bind-production / bind-dev-seed (spec § 2.2 Rule E1).
|
|
// J — Direct `payload.jobs.*` access is forbidden outside the integration
|
|
// layer. Use IJobQueue (from @repo/core-shared/jobs) instead.
|
|
// Events + jobs rules are added here when @repo/core-events is scaffolded
|
|
// via `pnpm turbo gen core-package events`.
|
|
// <gen:events-rules>
|
|
// R2 / R1 (ADR-016) — realtime-specific ESLint rules (no-direct-socket-io,
|
|
// no-realtime-handler-reexport) are added here when @repo/core-realtime is
|
|
// scaffolded via `pnpm turbo gen core-package realtime`.
|
|
// <gen:realtime-rules>
|
|
];
|