How to use the leasot.report 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.

github pgilad / gulp-todo / lib / reporter.js View on Github external
return through.obj(function(file, enc, cb) {
        if (file.isNull()) {
            return cb(null, file);
        }

        if (file.isStream()) {
            return cb(new PluginError(pluginName, 'Streaming not supported'));
        }

        // replace contents with requested reporter contents
        if (file.todos && file.todos.length) {
            const newContents = leasot.report(file.todos, reporter, reportOptions);

            if (fileName) {
                file.path = path.join(file.base, fileName);
            }
            file.contents = Buffer.from(newContents);
        }

        cb(null, file);
    });
};
github pgilad / gulp-todo / index.js View on Github external
function reportTodos(cb) {
            if (!firstFile) {
                return cb();
            }
            const reporterContents = leasot.report(comments, reporter, reportOptions);

            const todoFile = new Vinyl({
                base: firstFile.base,
                contents: Buffer.from(reporterContents),
                cwd: firstFile.cwd,
                path: path.join(firstFile.base, fileName),
            });

            // also pass along comments object for future reporters
            todoFile.todos = comments;
            cb(null, todoFile);
        }
    );

leasot

Parse and output TODOs and FIXMEs from comments in your files

MIT
Latest version published 2 months ago

Package Health Score

78 / 100
Full package analysis

Similar packages