Skip to content

New option - Curly braces on statements #4262

@igor-ribeiro

Description

@igor-ribeiro

First, thanks for that great tool!

It would be good to have an option to add curly braces on statements.

Prettier 1.11.1
Playground link

--range-end 
--range-start 

Input:

if (true)
  console.log(true);

Output:

if (true) console.log(true);

Expected behavior:

if (true) {
  console.log(true);
}

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:option requestIssues requesting a new option. We generally don’t accept these unless there is technical necessity.type:questionQuestions and support requests. Please use Stack Overflow for them, not the issue tracker.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions