How to use the comment-parser.default function in comment-parser

To help you get started, we’ve selected a few comment-parser examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github gajus / eslint-plugin-jsdoc / src / iterateJsdoc.js View on Github external
const parseComment = (commentNode, indent, trim = true) => {
  // Preserve JSDoc block start/end indentation.
  return commentParser(`${indent}/*${commentNode.value}${indent}*/`, {
    // @see https://github.com/yavorskiy/comment-parser/issues/21
    parsers: [
      commentParser.PARSERS.parse_tag,
      skipSeeLink(commentParser.PARSERS.parse_type),
      skipSeeLink(
        (str, data) => {
          if ([
            'example', 'return', 'returns', 'throws', 'exception',
            'access', 'version', 'since', 'license', 'author',
          ].includes(data.tag)) {
            return null;
          }

          return commentParser.PARSERS.parse_name(str, data);
        },
      ),

comment-parser

Generic JSDoc-like comment parser

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis