/** * @fileoverview Null-safety recipe config and safe-by-construction allowlists. */ export { SAFE_BUILDER_PREFIXES, SAFE_FLUENT_METHOD_NAMES, isSafeFluentMethod, } from './null-safety-prefixes.js'; /** * Recipe-config shape for null-safety. Project-specific safe-by-construction * paths and factory/builder symbols belong in a recipe's * `checks.config['null-safety']` block, not in the check's built-in defaults. */ export interface NullSafetyConfig extends Record { /** * Additional path patterns whose files are skipped entirely. Each entry * is compiled to a case-insensitive RegExp via `new RegExp(entry, 'i')`. */ additionalSafeNullPaths?: readonly string[]; /** * Additional call-text prefixes treated as non-null by construction (a * property access on a matching call result is not flagged). Use this for * PROJECT-SPECIFIC factory/builder functions whose non-null contract is * local to your codebase — do not hardcode them into the shipped check. * Matched via `String.prototype.startsWith` against the full call text. */ additionalSafeBuilders?: readonly string[]; /** * Use TYPE-AWARE analysis (a real `ts.Program` + `TypeChecker`): a property * access on a call/element-access result is flagged only when the receiver's * ACTUAL static type includes `null`/`undefined` (`any`/`unknown`/unresolved → * not flagged; the checker also handles control-flow narrowing, builder/Zod * return types, and chain depth, so the verb-prefix convention does not apply). * `additionalSafeBuilders` remains a manual escape hatch for symbols the checker * cannot resolve. * * **Default `true`** (D2). Set `false` to fall back to the legacy * name/convention heuristic (faster, no Program build, but higher * false-negative rate — it trusts any `get*`/`find*`/… call as non-null). */ typeAware?: boolean; } /** Patterns that indicate the access is already protected */ export declare const SAFE_PATTERNS: RegExp[]; /** * Common method name prefixes that indicate safe (non-null) return values. */ export declare const SAFE_METHOD_PREFIXES: string[]; /** Merge built-in defaults with the recipe-config slice. */ export declare function buildEffectiveSafePaths(): readonly RegExp[]; /** Merge built-in safe-builder prefixes with recipe-config augmentation. */ export declare function buildEffectiveSafeBuilders(): readonly string[]; export declare function isSafeNullPath(filePath: string, paths: readonly RegExp[]): boolean; //# sourceMappingURL=null-safety-config.d.ts.map