diff --git a/src/fns/getParsers.js b/src/fns/getParsers.js index eea752c..54ae6ab 100644 --- a/src/fns/getParsers.js +++ b/src/fns/getParsers.js @@ -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', diff --git a/tests/e2e/fixtures/random-05.fixture.js b/tests/e2e/fixtures/random-05.fixture.js new file mode 100644 index 0000000..2e57fd8 --- /dev/null +++ b/tests/e2e/fixtures/random-05.fixture.js @@ -0,0 +1,17 @@ +module.exports = { + printWidth: 90 +}; + +//# input + +/** + * @typedef {import('./MemoriesAlgoliaRecord').MemoriesAlgoliaRecord} + * MemoriesAlgoliaRecord + */ + +//# output + +/** + * @typedef {import('./MemoriesAlgoliaRecord').MemoriesAlgoliaRecord} + * MemoriesAlgoliaRecord + */