Skip to content

@babel/generator docs does not specify the return type of generate #3090

Closed
@joeedh

Description

@joeedh

This is the example from the page:

import { parse } from "@babel/parser";
import { generate } from "@babel/generator";

const code = "class Example {}";
const ast = parse(code);

const output = generate(
  ast,
  {
    /* options */
  },
  code
);

Seriosuly? At the bottom of the page there is one example that includes const { code, map } = generate but who knows what code or map are?

Activity

babel-bot

babel-bot commented on May 14, 2025

@babel-bot
Contributor

Hey @joeedh! We really appreciate you taking the time to report an issue. The collaborators
on this project attempt to help as many people as possible, but we're a limited number of volunteers,
so it's possible this won't be addressed swiftly.

If you need any help, or just have general Babel or JavaScript questions, we have a vibrant Slack
community
that typically always has someone willing to help. You can sign-up here
for an invite.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      Participants

      @joeedh@babel-bot

      Issue actions

        @babel/generator docs does not specify the return type of generate · Issue #3090 · babel/website