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 Oct 11, 2024
1 parent 2c93ef9 commit e535334
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 e535334

Please sign in to comment.