Skip to content

Commit

Permalink
Update jsdoc-plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
matz3 committed Oct 28, 2022
1 parent 93c1ccc commit 3584a6e
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions jsdoc-plugin.cjs
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
/*
* Removes JSDoc comments with TypeScript import() declarations (used in index.js)
* This plugin fixes unexpected JSDoc behavior that prevents us from using types that start with an at-sign (@).
* JSDoc doesn't see "{@" as a valid type expression, probably as there's also {@link ...}.
*/

const IMPORT_PATTERN = /{(?:typeof )?import\(["'][^"']*["']\)[ .|}><,)=#\n]/;

exports.handlers = {
jsdocCommentFound: function(e) {
if (IMPORT_PATTERN.test(e.comment)) {
e.comment = "";
}
e.comment = e.comment.replace(/{@ui5\//g, "{ @ui5/");
}
};

0 comments on commit 3584a6e

Please sign in to comment.