Skip to content

Commit

Permalink
fix: detect tags' names on a different line
Browse files Browse the repository at this point in the history
  • Loading branch information
homer0 committed Dec 23, 2022
1 parent 62d89f8 commit 051bea0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
7 changes: 3 additions & 4 deletions packages/public/prettier-plugin-jsdoc/src/fns/getParsers.js
Expand Up @@ -76,10 +76,9 @@ const generateCommentData = (comment) => {
start: { column },
},
} = comment;
const commentText = comment.value.replace(
/^(\s*\*\s*@[a-z]+){/gim,
(_, group) => `${group} {`,
);
const commentText = comment.value
.replace(/^(\s*\*\s*@[a-z]+){/gim, (_, group) => `${group} {`)
.replace(/(\s*\*\s*@[a-z]+\s+\{.*?\})\n(\s*\*)\s*(\w+)(?:\n|$)/gi, '$1 $3\n$2');
const [block] = commentParser(`/*${commentText}*/`, {
dotted_names: false,
spacing: 'preserve',
Expand Down
@@ -0,0 +1,17 @@
module.exports = {
printWidth: 90
};

//# input

/**
* @typedef {import('./MemoriesAlgoliaRecord').MemoriesAlgoliaRecord}
* MemoriesAlgoliaRecord
*/

//# output

/**
* @typedef {import('./MemoriesAlgoliaRecord').MemoriesAlgoliaRecord}
* MemoriesAlgoliaRecord
*/

0 comments on commit 051bea0

Please sign in to comment.