Skip to content

Commit

Permalink
Add @import to the tag making a JSDoc comment worth keeping
Browse files Browse the repository at this point in the history
Without it, internal types like `AccordionConfig` will be unresolved in the built files as the `@import` comments are dropped
  • Loading branch information
romaricpascal committed Nov 15, 2024
1 parent 533815f commit bcdae6f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/govuk-frontend/babel.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,12 @@ module.exports = function (api) {
)

// Flag any JSDoc comments worth keeping
const isDocumentation = ['* @param', '* @returns', '* @typedef'].some(
(tag) => comment.includes(tag)
)
const isDocumentation = [
'* @param',
'* @returns',
'* @typedef',
'* @import'
].some((tag) => comment.includes(tag))

// Print only public JSDoc comments
return !isPrivate && isDocumentation
Expand Down

0 comments on commit bcdae6f

Please sign in to comment.