Skip to content

Commit d84dcc5

Browse files
committed
fix: printWidth
1 parent 86e7ebb commit d84dcc5

2 files changed

Lines changed: 12 additions & 14 deletions

File tree

src/descriptionFormatter.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -315,11 +315,9 @@ async function formatDescription(
315315
const applyGreedyWrapping = (text: string): string => {
316316
const singleLine = text.replace(/\s+/g, " ");
317317
const formatted = applyStandardFormatting(singleLine);
318-
const jsdocPrintWidth =
319-
options.jsdocPrintWidth ?? printWidth;
320318
return breakDescriptionToLines(
321319
formatted,
322-
jsdocPrintWidth,
320+
printWidth,
323321
intention,
324322
);
325323
};
@@ -339,12 +337,10 @@ async function formatDescription(
339337
.map((line) => line.trim())
340338
.filter((line) => line.length > 0);
341339
342-
const jsdocPrintWidth =
343-
options.jsdocPrintWidth ?? printWidth;
344340
const effectiveMaxWidth =
345341
tag === DESCRIPTION && tagStringLength > 0
346-
? jsdocPrintWidth - tagStringLength
347-
: jsdocPrintWidth - intention.length;
342+
? printWidth - tagStringLength
343+
: printWidth - intention.length;
348344
349345
const allLinesFit = originalLines.every(
350346
(line) => line.length <= effectiveMaxWidth,

tests/__snapshots__/descriptions.test.ts.snap

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,13 +1046,15 @@ exports[`numbers and code in description 4`] = `
10461046
10471047
exports[`printWidth 1`] = `
10481048
"/**
1049-
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1050-
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1051-
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1052-
*
1053-
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1054-
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1055-
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1049+
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1050+
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1051+
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1052+
* A
1053+
*
1054+
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1055+
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1056+
* A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A
1057+
* A
10561058
*/
10571059
"
10581060
`;

0 commit comments

Comments
 (0)