/** * Validate No Unmanaged Exceptions Executor * * Validates that try/catch blocks are not used outside chokepoints. * Uses LINE-BASED detection (not method-based) for git diff filtering. * * ============================================================================ * VIOLATIONS (BAD) - These patterns are flagged: * ============================================================================ * * - try { — any try/catch block in non-test code * * ============================================================================ * ALLOWED (skip — NOT violations) * ============================================================================ * * - Test files (.spec.ts, .test.ts, __tests__/) * - Lines with // webpieces-disable no-unmanaged-exceptions -- [reason] * * ============================================================================ * MODES (LINE-BASED) * ============================================================================ * - OFF: Skip validation entirely * - MODIFIED_CODE: Flag try/catch on changed lines (lines in diff hunks) * - MODIFIED_FILES: Flag ALL try/catch in files that were modified * * ============================================================================ * ESCAPE HATCH * ============================================================================ * Add comment above the violation: * // webpieces-disable no-unmanaged-exceptions -- [your justification] * try { */ import type { ExecutorContext } from '@nx/devkit'; export type NoUnmanagedExceptionsMode = 'OFF' | 'MODIFIED_CODE' | 'MODIFIED_FILES'; export interface ValidateNoUnmanagedExceptionsOptions { mode?: NoUnmanagedExceptionsMode; disableAllowed?: boolean; ignoreModifiedUntilEpoch?: number; } export interface ExecutorResult { success: boolean; } export default function runExecutor(options: ValidateNoUnmanagedExceptionsOptions, context: ExecutorContext): Promise;