/** * Validate No Implicit Any Executor * * Flags function parameters, variables, and object-literal properties whose * types collapse to the implicit `any` produced by TypeScript inference when * an annotation is missing. Pairs with validate-no-any-unknown (which bans * the literal keyword) so together they force developers to write real types. * * Detection leverages the TypeScript compiler directly: we build a ts.Program * from the project's tsconfig.json with `noImplicitAny: true` overridden, then * filter pre-emit diagnostics to the set of codes that describe implicit-any * inferences (TS7006, TS7005, TS7018, etc.) and map them back to changed lines. * * ============================================================================ * MODES (LINE-BASED) * ============================================================================ * - OFF: Skip validation entirely. * - MODIFIED_CODE: Flag implicit-any on changed lines (lines in diff hunks). * - MODIFIED_FILES: Flag ALL implicit-any in files that were modified. * * ============================================================================ * ESCAPE HATCH * ============================================================================ * // webpieces-disable no-implicit-any -- [your justification] * function handler(x) { ... } */ import type { ExecutorContext } from '@nx/devkit'; export type NoImplicitAnyMode = 'OFF' | 'MODIFIED_CODE' | 'MODIFIED_FILES'; export interface ValidateNoImplicitAnyOptions { mode?: NoImplicitAnyMode; disableAllowed?: boolean; ignoreModifiedUntilEpoch?: number; } export interface ExecutorResult { success: boolean; } export default function runExecutor(options: ValidateNoImplicitAnyOptions, context: ExecutorContext): Promise;