Files
gridpilot.gg/apps/website/tests/guardrails/allowed-violations.ts
2026-01-12 02:09:30 +01:00

88 lines
2.6 KiB
TypeScript

/**
* Allowlist for architecture guardrail violations
*
* This file contains violations that currently exist in the codebase.
* In future slices, these should be shrunk to zero.
*
* Format: Each rule has an array of file paths that are allowed to violate it.
*/
export interface GuardrailAllowlist {
[ruleName: string]: string[];
}
export const ALLOWED_VIOLATIONS: GuardrailAllowlist = {
// Rule 1: ContainerManager usage in server page queries
'no-container-manager-in-server': [],
// Rule 2: PageDataFetcher.fetch() usage in server page queries
'no-page-data-fetcher-fetch-in-server': [],
// Rule 3: ViewModels imported in forbidden paths
'no-view-models-in-server': [],
// Rule 4: Templates importing view-models or display-objects
'no-view-models-in-templates': [],
// Rule 5: Intl.* or toLocale* in presentation paths
'no-intl-in-presentation': [],
// Rule 6: Client-side fetch with write methods
'no-client-write-fetch': [
'apps/website/app/sponsor/signup/page.tsx',
],
// Rule 7: *Template.tsx files under app/
'no-templates-in-app': [],
// Rule 8: 'as any' usage - ZERO TOLERANCE
// Hard fail - no allowlist entries allowed
'no-as-any': [],
// New Rule 1: RSC boundary - additional checks
'no-presenters-in-server': [],
'no-sorting-filtering-in-server': [],
'no-display-objects-in-server': [],
'no-unsafe-services-in-server': [],
'no-di-in-server': [],
'no-local-helpers-in-server': [],
'no-object-construction-in-server': [],
'no-container-manager-calls-in-server': [],
// New Rule 2: Template purity - additional checks
'no-state-hooks-in-templates': [],
'no-computations-in-templates': [],
'no-restricted-imports-in-templates': [],
'no-invalid-template-signature': [],
'no-template-helper-exports': [],
'invalid-template-filename': [],
// New Rule 3: Display Object guardrails
'no-io-in-display-objects': [],
'no-non-class-display-exports': [],
// New Rule 4: Page Query guardrails
'no-null-returns-in-page-queries': [],
'invalid-page-query-filename': [],
// New Rule 5: Services guardrails
'no-service-state': [],
'no-blockers-in-services': [],
'no-dto-variable-name': [],
// New Rule 6: Client-only guardrails
'no-use-client-directive': [],
'no-viewmodel-imports-from-server': [],
'no-http-in-presenters': [],
// New Rule 7: Write boundary guardrails
'no-server-action-imports-from-client': [],
'no-server-action-viewmodel-returns': [],
// New Rule 10: Generated DTO isolation
'no-generated-dto-in-ui': [],
'no-types-in-templates': [],
// New Rule 11: Filename rules
'invalid-app-filename': [],
};