morbo-cli
Version:
… All tech debt is vermin in the eyes of Morbo!
17 lines (13 loc) • 410 B
text/typescript
const inline = '\\/\\/';
const block = '\\*';
const jsx = '\\{#';
const jsx2 = '\\{/\\/\\*';
const hash = '#';
const html = '<!--';
const commentPrefixesRegex = `(${inline}|${html}|${jsx}|${jsx2}|${block}|${hash})`;
const commentRegex = (value: string) =>
new RegExp(
`(?:^|[^:])${commentPrefixesRegex}\\s*@?${value}\\b\\s*(?:\\(([^:]*)\\))*\\s*:?\\s*(.*)`,
'i',
);
export default commentRegex;