eslint-plugin-jsdoc 65.2.2 → 65.2.3
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
|
@@ -64,7 +64,7 @@ export default {
|
|
|
64
64
|
* @param {string} messageId
|
|
65
65
|
* @param {import('estree').Comment|Token} comment
|
|
66
66
|
* @param {import('eslint').Rule.Node} node
|
|
67
|
-
* @param {import('eslint').Rule.ReportFixer} fixer
|
|
67
|
+
* @param {import('eslint').Rule.ReportFixer|null} fixer
|
|
68
68
|
*/
|
|
69
69
|
const report = (messageId, comment, node, fixer) => {
|
|
70
70
|
const loc = {
|
|
@@ -167,9 +167,21 @@ export default {
|
|
|
167
167
|
* @param {Token} [locComment] Comment to anchor the report location to,
|
|
168
168
|
* e.g., the first comment of a stacked group of line comments, so the
|
|
169
169
|
* report does not read as though only the last line were at fault.
|
|
170
|
+
* @param {Token[]} [commentGroup] The comments which the fixer would
|
|
171
|
+
* convert. Defaults to just `comment`.
|
|
170
172
|
*/
|
|
171
|
-
const reportings = (comment, node, addComment, ctxts, locComment
|
|
172
|
-
|
|
173
|
+
const reportings = (comment, node, addComment, ctxts, locComment, commentGroup = [
|
|
174
|
+
/** @type {Token} */ (comment),
|
|
175
|
+
]) => {
|
|
176
|
+
// A `*/` inside a comment's text would end the generated JSDoc block
|
|
177
|
+
// early, so leave such comments for the user to convert
|
|
178
|
+
const fixer = commentGroup.some(({
|
|
179
|
+
value,
|
|
180
|
+
}) => {
|
|
181
|
+
return value.includes('*/');
|
|
182
|
+
}) ?
|
|
183
|
+
null :
|
|
184
|
+
getFixer(node, comment, addComment, ctxts);
|
|
173
185
|
|
|
174
186
|
if (comment.type === 'Block') {
|
|
175
187
|
if (lineOrBlockStyle === 'line') {
|
|
@@ -310,7 +322,7 @@ export default {
|
|
|
310
322
|
);
|
|
311
323
|
};
|
|
312
324
|
|
|
313
|
-
reportings(comment, node, addComment, contexts, commentGroup[0]);
|
|
325
|
+
reportings(comment, node, addComment, contexts, commentGroup[0], commentGroup);
|
|
314
326
|
};
|
|
315
327
|
|
|
316
328
|
/**
|