Skip to content

arrowFunction.useParentheses = preferNone removes parens that are required with optional param #348

@jakebailey

Description

@jakebailey

Describe the bug

dprint-plugin-typescript version: 0.64.2

With "arrowFunction.useParentheses": "preferNone" set, parens are removed from the following code, even though doing so makes the code invalid.

Playground Link

Input Code

function foo() {
    return {
        getFalseType: (fresh?) => fresh ? falseType : regularFalseType,
    }
}

Expected Output

function foo() {
    return {
        getFalseType: (fresh?) => fresh ? falseType : regularFalseType,
    };
}

Actual Output

function foo() {
    return {
        getFalseType: fresh? => fresh ? falseType : regularFalseType,
    };
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions