How to use the leasot.reporter function in leasot

To help you get started, we’ve selected a few leasot 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 mikeerickson / todo-webpack-plugin / index.js View on Github external
customTags: options.tags,
      reporter: options.reporter,
      withInlineFiles: options.withInlineFiles
    });
    todos = todos.concat(todo);
  });

  if (options.console) {
    output = leasot.reporter(todos, { reporter: 'table', spacing: 2 });
    if (options.relativeFilePath) {
      output = relativePath(output);
    }
    console.log(output + "\n"); // eslint-disable-line
  }

  output = leasot.reporter(todos, { reporter: options.reporter, spacing: 2 });

  if (output.length > 0) {
    let outputFilename = options.filename || '';
    if (outputFilename.length === 0) {
      outputFilename =
        options.reporter === 'markdown'
          ? 'TODO.md'
          : 'todo.' + options.reporter;
      if (options.reporter === 'table') {
        outputFilename = 'todo.txt';
      }
    }

    if (!options.suppressFileOutput) {
      if (options.relativeFilePath) {
        output = relativePath(output);
github mikeerickson / todo-webpack-plugin / index.js View on Github external
}
    }

    const todo = leasot.parse({
      ext: path.extname(file),
      content: fs.readFileSync(file, 'utf8'),
      fileName: file,
      customTags: options.tags,
      reporter: options.reporter,
      withInlineFiles: options.withInlineFiles
    });
    todos = todos.concat(todo);
  });

  if (options.console) {
    output = leasot.reporter(todos, { reporter: 'table', spacing: 2 });
    if (options.relativeFilePath) {
      output = relativePath(output);
    }
    console.log(output + "\n"); // eslint-disable-line
  }

  output = leasot.reporter(todos, { reporter: options.reporter, spacing: 2 });

  if (output.length > 0) {
    let outputFilename = options.filename || '';
    if (outputFilename.length === 0) {
      outputFilename =
        options.reporter === 'markdown'
          ? 'TODO.md'
          : 'todo.' + options.reporter;
      if (options.reporter === 'table') {

leasot

Parse and output TODOs and FIXMEs from comments in your files

MIT
Latest version published 5 months ago

Package Health Score

73 / 100
Full package analysis