jsdoc-scribe API/lib/fixCurrent
Functions(9)
#todoParamDescription
line 57
ParameterTypeOptionalDescription
nameany
Returns: any
Signature
todoParamDescription(name: any): any
#ensureSentence
line 61
ParameterTypeOptionalDescription
textany
Returns: any
Signature
ensureSentence(text: any): any
#indentOf
line 68
Exact indentation string of the line `pos` sits on — reused for every continuation line.
ParameterTypeOptionalDescription
sourceTextany
posany
Returns: any
Signature
indentOf(sourceText: any, pos: any): any
#scanOtherTagLines
line 97
Every `@tag` line that isn't one of the seven concepts rebuilt structurally above — kept verbatim (not reformatted), so a full rebuild never silently drops real content it doesn't have a structured slot for (e.g. `@readonly`, `@static`, `@abstract`), and never renames a tag it can't safely interpret (e.g. an unknown/typo'd tag — check-tag-names' territory, left for a human). A tag known to carry no description (NO_DESC_TAGS) still gets its trailing text stripped here — same transform empty-tags asks for, just applied inline since these lines bypass the rest of the rebuild.
ParameterTypeOptionalDescription
rawCommentany
Returns: any
Signature
scanOtherTagLines(rawComment: any): any
#rebuildFunctionBlock
line 118
ParameterTypeOptionalDescription
symany
indentany
Returns: any
Signature
rebuildFunctionBlock(sym: any, indent: any): any
#lightFixGenericBlock
line 177
ParameterTypeOptionalDescription
symany
rulesany
Returns: any
Signature
lightFixGenericBlock(sym: any, rules: any): any
#fixModule
line 235
Fix every symbol in `filePath` that lintModule() flagged, where a safe or placeholder-based fix exists. Writes the file in place (same "no dry-run" contract `--fix` follows everywhere else it's implemented) if — and only if — at least one edit applies; a file with zero fixable issues is never touched, byte-identical before and after.
ParameterTypeOptionalDescription
filePathstring
Returns: { fixedCount: number, totalBefore: number, remainingIssues: Array }
Signature
fixModule(filePath: any): any
#tryFunctionLike
line 248
ParameterTypeOptionalDescription
symany
symbolKeyany
Signature
tryFunctionLike(sym: any, symbolKey: any)
#tryGeneric
line 260
ParameterTypeOptionalDescription
symany
symbolKeyany
Signature
tryGeneric(sym: any, symbolKey: any)
Variables & Constants(46)
const fs: any
const
lib/fix.js ---------------------------------------- `gen-comments --lint --fix`'s engine. Rewrites EXISTING, malformed JSDoc blocks to resolve lintModule()'s findings — it does not add JSDoc to undocumented symbols (that's `--write`'s job; a require-jsdoc finding with no existing block at all is left alone here). Two fix strategies, matched to two kinds of symbol (see docs/backlog/adr-013-lint-autofix.md for the full reasoning): 1. Function-like symbols (functions, methods, constructors) — the whole block is REBUILT from real AST truth (actual param names/order/types, actual return type) merged with whatever valid prose already existed. This one rebuild naturally fixes require-param, require-param-description, check-param-names (ordering), require-returns, require-returns-description, require-returns-check, require-description, empty-tags, and no-multi-asterisks/no-blank-block-descriptions in a single pass — a symbol with zero lint issues is left completely untouched (byte-identical). 2. Generic symbols (classes, interfaces, typeAliases, enums, variables, getters, setters, properties) — a lighter, line-level fix: strip trailing text after a no-description tag, collapse stray asterisks, insert one placeholder description line if the block is blank or has none. No attempt to rebuild @property/@enum-style tag lists — those aren't lint-checked today and rebuilding them risks losing real content. One deliberate carve-out, in both strategies: `check-tag-names` (an unknown / typo'd tag) is NEVER auto-fixed. Every other fix here either applies a fixed, deterministic placeholder template (never invented prose) or performs a lossless mechanical transform (reorder, strip, collapse). Renaming a typo'd tag would mean guessing what the author meant to type — there is no safe default for that, so `check-tag-names` findings always survive a `--fix` run and are reported as such.
Signature
const fs: any
#{ extractModule }
line 40
const { extractModule }: any
const
Signature
const { extractModule }: any
#{ lintModule, KNOWN_TAGS, NO_DESC_TAGS }
line 41
const { lintModule, KNOWN_TAGS, NO_DESC_TAGS }: any
const
Signature
const { lintModule, KNOWN_TAGS, NO_DESC_TAGS }: any
#TODO_DESCRIPTION
line 55
const TODO_DESCRIPTION: string
const
Signature
const TODO_DESCRIPTION: string
#TODO_RETURNS_DESCRIPTION
line 56
const TODO_RETURNS_DESCRIPTION: string
const
Signature
const TODO_RETURNS_DESCRIPTION: string
const t: any
const
Signature
const t: any
let i: any
var
Signature
let i: any
#STRUCTURAL_TAGS
line 80
const STRUCTURAL_TAGS: Set
const
Signature
const STRUCTURAL_TAGS: Set
const inner: any
const
Signature
const inner: any
const lines: any
const
Signature
const lines: any
const out: Array
const
Signature
const out: Array
const m: any
const
Signature
const m: any
const lines: Array
const
Signature
const lines: Array
#docByName
line 127
const docByName: Map
const
Signature
const docByName: Map
#existing
line 129
const existing: any
const
Signature
const existing: any
const type: any
const
Signature
const type: any
const desc: any
const
Signature
const desc: any
const label: any
const
Signature
const label: any
const label: any
const
Signature
const label: any
const desc: any
const
Signature
const desc: any
const desc: any
const
Signature
const desc: any
#reallyReturnsAValue
line 150
const reallyReturnsAValue: any
const
Signature
const reallyReturnsAValue: any
const type: any
const
Signature
const type: any
const desc: any
const
Signature
const desc: any
let lines: any
var
Signature
let lines: any
#changed
line 180
let changed: boolean
var
Signature
let changed: boolean
#stripped
line 184
const stripped: any
const
Signature
const stripped: any
const m: any
const
Signature
const m: any
#closer
line 187
const closer: any
const
Signature
const closer: any
#trailing
line 188
const trailing: any
const
Signature
const trailing: any
#prefixMatch
line 191
const prefixMatch: any
const
Signature
const prefixMatch: any
#prefix
line 192
const prefix: any
const
Signature
const prefix: any
#sourceText
line 236
const sourceText: any
const
Signature
const sourceText: any
#moduleData
line 237
const moduleData: any
const
Signature
const moduleData: any
#issuesBefore
line 238
const issuesBefore: any
const
Signature
const issuesBefore: any
#issuesBySymbol
line 240
const issuesBySymbol: Map
const
Signature
const issuesBySymbol: Map
const edits: Array
const
Signature
const edits: Array
#symIssues
line 249
const symIssues: any
const
Signature
const symIssues: any
#fixable
line 252
const fixable: any
const
Signature
const fixable: any
#indent
line 254
const indent: any
const
Signature
const indent: any
#newText
line 255
const newText: any
const
Signature
const newText: any
#symIssues
line 261
const symIssues: any
const
Signature
const symIssues: any
const rules: Set
const
Signature
const rules: Set
#newText
line 265
const newText: any
const
Signature
const newText: any
#output
line 289
let output: any
var
Signature
let output: any
#remainingIssues
line 295
const remainingIssues: any
const
Signature
const remainingIssues: any