eslint-plugin-jsdoc 65.2.3 → 65.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -163,5 +163,5 @@
163
163
  "test-cov": "TIMING=1 c8 --reporter text pnpm run test-no-cov",
164
164
  "test-index": "pnpm run test-no-cov test/rules/index.js"
165
165
  },
166
- "version": "65.2.3"
166
+ "version": "65.2.5"
167
167
  }
@@ -1418,6 +1418,7 @@ const getUtils = (
1418
1418
  source: '',
1419
1419
  tokens: seedTokens({
1420
1420
  delimiter: '*',
1421
+ lineEnd: newLineEnd,
1421
1422
  start: indent + ' ',
1422
1423
  }),
1423
1424
  };
@@ -229,6 +229,7 @@ export default iterateJsdoc(({
229
229
  ...tokens,
230
230
  };
231
231
  utils.emptyTokens(tokens);
232
+ tokens.lineEnd = utils.newLineEnd;
232
233
  const {
233
234
  tokens: {
234
235
  delimiter,
@@ -294,6 +295,7 @@ export default iterateJsdoc(({
294
295
  ...line,
295
296
  delimiter,
296
297
  end: '',
298
+ lineEnd: utils.newLineEnd,
297
299
  });
298
300
  };
299
301
 
@@ -715,10 +715,12 @@ export default {
715
715
  } = contxt;
716
716
  return ctxt === node.type;
717
717
  })) || {};
718
+ // Use the line break of the source for the generated block
719
+ const lineBreak = sourceCode.text.includes('\r\n') ? '\r\n' : '\n';
718
720
  const insertion = (inlineCommentBlock ?
719
721
  `/** ${fixerMessage}` :
720
- `/**\n${indent}*${fixerMessage}\n${indent}`) +
721
- `*/${'\n'.repeat(lines)}${indent.slice(0, -1)}`;
722
+ `/**${lineBreak}${indent}*${fixerMessage}${lineBreak}${indent}`) +
723
+ `*/${lineBreak.repeat(lines)}${indent.slice(0, -1)}`;
722
724
 
723
725
  return fixer.insertTextBefore(
724
726
  /** @type {import('eslint').Rule.Node} */
@@ -441,7 +441,7 @@ export default iterateJsdoc(({
441
441
  delimiter: '*',
442
442
  description: '',
443
443
  end: '',
444
- lineEnd: '',
444
+ lineEnd: utils.newLineEnd,
445
445
  name: functionParameterName,
446
446
  newAdd: true,
447
447
  postDelimiter: ' ',
@@ -52,6 +52,7 @@ const checkMaxBlockLines = ({
52
52
  tokens: seedTokens({
53
53
  ...info,
54
54
  description: desc,
55
+ lineEnd: utils.newLineEnd,
55
56
  postDelimiter: newPostDelims[idx],
56
57
  }),
57
58
  };
@@ -327,6 +328,7 @@ export default iterateJsdoc(({
327
328
  tokens: seedTokens({
328
329
  ...info,
329
330
  description: desc,
331
+ lineEnd: utils.newLineEnd,
330
332
  postDelimiter: postDelims[idx],
331
333
  }),
332
334
  };
@@ -356,6 +358,7 @@ export default iterateJsdoc(({
356
358
  tokens: seedTokens({
357
359
  ...info,
358
360
  description: desc,
361
+ lineEnd: utils.newLineEnd,
359
362
  postDelimiter: desc.trim() ? postDelims[idx] : '',
360
363
  }),
361
364
  };