import type { Maybe } from '@dereekb/util'; interface AstNode { readonly type: string; [key: string]: any; } /** * Options for the prefer-canonical-jsdoc rule. Each `checkX` flag toggles a related group of * messageIds; default is `true` for all checks. */ export interface UtilPreferCanonicalJsdocRuleOptions { readonly checkDescription?: boolean; readonly checkParam?: boolean; readonly checkReturns?: boolean; readonly checkThrows?: boolean; readonly checkTagOrder?: boolean; readonly checkExampleFence?: boolean; readonly checkTypeRestating?: boolean; readonly checkSingleLine?: boolean; readonly workspaceTagPrefixes?: readonly string[]; } /** * ESLint rule definition for prefer-canonical-jsdoc. */ export interface UtilPreferCanonicalJsdocRuleDefinition { readonly meta: { readonly type: 'suggestion'; readonly fixable: 'code'; readonly docs: { readonly description: string; readonly recommended: boolean; }; readonly messages: Readonly>; readonly schema: readonly object[]; }; create(context: { options: UtilPreferCanonicalJsdocRuleOptions[]; report: (descriptor: { node?: AstNode; loc?: AstNode; messageId: string; data?: Record; fix?: (fixer: AstNode) => Maybe; }) => void; sourceCode: AstNode; }): Record void>; } /** * ESLint rule enforcing the workspace's canonical JSDoc shape. Applies only when a JSDoc block * already exists on a function-like declaration; presence is `jsdoc/require-jsdoc`'s concern. * * The rule defends the shape established across `@dereekb/util`, `@dereekb/date`, `@dereekb/firebase`, * and `@dereekb/dbx-core`: * * - Description: capitalized first paragraph ending with terminal punctuation, optional elaboration paragraphs * separated by exactly one blank `* ` line. * - `@param name - Capitalized description.` with hyphen and surrounding spaces. * - `@returns Capitalized description.` without a hyphen. * - `@throws {ErrorType} Capitalized condition.` with brace-wrapped error type. * - Tag order: `@param*`, `@returns`, `@throws*`, workspace tags (`@dbx*`, `@see`), `@example`, `@__NO_SIDE_EFFECTS__`. * - `@example` body fenced as triple-backtick `ts` block. * - No type-restating descriptions ("a string …", "an array of …"). * - Single-line JSDocs forbidden on functions with parameters. * * Heuristics are tuned to pass on the canonical examples in the existing codebase; warnings on * older non-canonical JSDocs are expected and acceptable per workspace policy. */ export declare const UTIL_PREFER_CANONICAL_JSDOC_RULE: UtilPreferCanonicalJsdocRuleDefinition; export {};