How to use the leasot.isExtensionSupported 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 pgilad / gulp-todo / index.js View on Github external
if (file.isNull()) {
                cb(null, file);
                return;
            }

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

            //get extension - assume .js as default
            const ext = path.extname(file.path) || '.js';

            //check if parser for filetype exists
            if (!leasot.isExtensionSupported(ext)) {
                if (!skipUnsupported) {
                    const msg = `File: ${file.path} with extension ${colors.red(ext)} is not supported`;
                    return cb(new PluginError(pluginName, msg));
                }
                if (verbose) {
                    const msg = `Skipping file ${file.path} with extension ${colors.red(ext)} as it is unsupported`;
                    fancyLog(msg);
                }
                return cb();
            }
            const filePath = absolute ? file.path : (file.path && file.relative) || file.path;

            const parsedComments = leasot.parse(file.contents.toString(), {
                associateParser: parseOptions.associateParser,
                customParsers: parseOptions.customParsers,
                customTags: parseOptions.customTags,

leasot

Parse and output TODOs and FIXMEs from comments in your files

MIT
Latest version published 1 year ago

Package Health Score

59 / 100
Full package analysis