How to use the acorn-loose.LooseParser function in acorn-loose

To help you get started, we’ve selected a few acorn-loose 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 M-Izadmehr / deadfile / src / ASTPlugins / index.js View on Github external
let Parser = require("acorn-loose");
let ParserWalk = require("acorn-walk");

const parseImportFromExport = require("./parseImportFromExport");
const parseJsx = require("./parseJsx");
const injectImportUsingExportWalk = require("./walk");

Parser = Parser.LooseParser.extend(parseImportFromExport);
ParserWalk = injectImportUsingExportWalk(ParserWalk);

const ParserWithJsx = entry => Parser.parse(parseJsx(entry));

module.exports = { Parser: ParserWithJsx, ParserWalk };

acorn-loose

Error-tolerant ECMAScript parser

MIT
Latest version published 1 year ago

Package Health Score

85 / 100
Full package analysis

Popular acorn-loose functions

Similar packages