How to use the markdownlint-rule-helpers.getLineMetadata function in markdownlint-rule-helpers

To help you get started, we’ve selected a few markdownlint-rule-helpers 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 DavidAnson / markdownlint / test / rules / every-n-lines.js View on Github external
"function": (params, onError) => {
    const n = params.config.n || 2;
    forEachLine(getLineMetadata(params), (line, lineIndex) => {
      const lineNumber = lineIndex + 1;
      if ((lineNumber % n) === 0) {
        onError({
          "lineNumber": lineNumber,
          "detail": "Line number " + lineNumber
        });
      }
    });
  }
};

markdownlint-rule-helpers

A collection of markdownlint helper functions for custom rules

MIT
Latest version published 4 months ago

Package Health Score

85 / 100
Full package analysis