interface AstNode { readonly type: string; [key: string]: any; } /** * ESLint rule definition for prefer-suggested-string. */ export interface UtilPreferSuggestedStringRuleDefinition { readonly meta: { readonly type: 'suggestion'; readonly docs: { readonly description: string; readonly recommended: boolean; }; readonly messages: { readonly preferSuggestedString: string; }; readonly schema: readonly object[]; }; create(context: { report: (descriptor: { node: AstNode; messageId: string; data?: Record; }) => void; sourceCode: { getText: (node: AstNode) => string; }; }): Record void>; } /** * ESLint rule that warns on union types of the shape `'a' | 'b' | string` — a literal-string * union members alongside a bare `string` member. * * The TypeScript compiler collapses such a union to `string`, erasing IDE autocomplete for the * literal members. Two outcomes are sane: * * 1. If autocomplete-preserving behavior is actually wanted, switch to `SuggestedString` from * `@dereekb/util` (the named alias for the `'a' | 'b' | (string & {})` workaround). * 2. If any string is fine and literals were just documentation, drop the literal members and * keep plain `string`. * * The rule is non-fixable: the right action depends on intent (#1 vs #2), and #1 also requires * adding an `import { type SuggestedString }` statement whose insertion point varies by file. The * warning message names both options so the developer can make the call. * * Only fires when the union contains BOTH a `TSStringKeyword` AND at least one literal-string * contributor. Unions like `string | number`, `'a' | 'b'`, or `string` alone are silent. */ export declare const UTIL_PREFER_SUGGESTED_STRING_RULE: UtilPreferSuggestedStringRuleDefinition; export {};