Skip to content

Trailing comment of IIFE function moved around #18539

@fisker

Description

@fisker

Prettier 3.7.4
Playground link

--parser babel

Input:

const b = (function (foo) {}/*comment*/)();

Output:

const b = (function (foo) {})(/*comment*/);

Expected output:

const b = (function (foo) {}/*comment*/)();

Why?

The comment is for function, not call.

Metadata

Metadata

Assignees

No one assigned

    Labels

    lang:javascriptIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions