How to use the recast/parsers/babel.parser function in recast

To help you get started, we’ve selected a few recast 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 lannonbr / vscode-js-annotations / src / parser.ts View on Github external
parse(source) {
        const babelParser = require("recast/parsers/babel").parser;
        const opts = {
          allowImportExportEverywhere: true,
          allowReturnOutsideFunction: true,
          plugins: [
            "asyncGenerators",
            "bigInt",
            "classPrivateMethods",
            "classPrivateProperties",
            "classProperties",
            "decorators-legacy",
            "doExpressions",
            "dynamicImport",
            "exportDefaultFrom",
            "exportExtensions",
            "exportNamespaceFrom",
            "functionBind",