interface AstNode { readonly type: string; [key: string]: any; } /** * ESLint fixer interface (loose-typed because the rule keeps its own no-deps `AstNode = any`). */ interface RuleFixer { readonly removeRange: (range: readonly [number, number]) => unknown; readonly replaceTextRange: (range: readonly [number, number], text: string) => unknown; readonly insertTextAfterRange: (range: readonly [number, number], text: string) => unknown; } /** * ESLint rule definition for require-deprecated-alias-placement. */ export interface UtilRequireDeprecatedAliasPlacementRuleDefinition { readonly meta: { readonly type: 'suggestion'; readonly fixable: 'code'; readonly docs: { readonly description: string; readonly recommended: boolean; }; readonly messages: { readonly missingCompatMarker: string; readonly deprecatedAliasNotAtBottom: string; readonly nonDeprecatedAfterMarker: string; }; readonly schema: readonly object[]; }; create(context: RuleContext): Record void>; } /** * Fix function signature used throughout the rule. Returned by helper builders and consumed by * `context.report({ fix })`. */ type FixFn = (fixer: RuleFixer) => unknown; /** * Narrow shape of the ESLint rule context the rule actually uses. */ interface RuleContext { readonly report: (descriptor: { node: AstNode; messageId: string; fix?: FixFn; }) => void; readonly sourceCode: AstNode; } /** * ESLint rule requiring that `@deprecated` *aliases* live at the bottom of the file under a * `// COMPAT: Deprecated aliases` line comment, and that no non-deprecated exports follow the * marker. The rule mirrors the workspace's "Deprecated Alias Placement" convention so that * deprecated aliases stay segregated from current code and are easy to spot for removal. * * Only *relocatable* deprecated statements participate (see {@link computeMovableStatements}): * type-only declarations (always runtime-safe to move) and runtime value aliases — a * `VariableDeclaration` whose initializer references a non-deprecated binding — that are not * referenced elsewhere in the file. Primary runtime definitions (literal-valued consts, functions, * classes, enums) and any value still referenced by other code are left exactly where they are, so * the autofix can never reorder a value below its uses (a use-before-declaration error). * * The rule reports at most one violation per concern (missing marker, alias above marker, * non-deprecated below marker) to keep editor noise manageable; once the first violation in a * category is fixed, re-linting will surface the next one. * * Autofix coverage: * - `missingCompatMarker` — inserts `// COMPAT: Deprecated aliases` and consolidates all movable * blocks at the bottom of the file. When the movable tail is already at the bottom of the file, * only the marker line is inserted (no statements are moved). When movable aliases are * interleaved with other statements, the autofix removes each movable block from its current * location and re-emits them in source order at the bottom of the file under the marker. * - `deprecatedAliasNotAtBottom` — moves the misplaced movable block from above the marker to * just after the marker. One block per pass; ESLint's autofix loop converges across multiple * violations. * - `nonDeprecatedAfterMarker` — moves the misplaced non-deprecated block from below the marker * to just before the marker. One block per pass. * * @see `dbx__note__typescript-programming` → Deprecated Alias Placement */ export declare const UTIL_REQUIRE_DEPRECATED_ALIAS_PLACEMENT_RULE: UtilRequireDeprecatedAliasPlacementRuleDefinition; export {};