Skip to content

Codefix to annotate with type from jsdoc reformats entire function #22358

Closed
@ghost

Description

TypeScript Version: 2.8.0-dev.20180302

Code

/** @param {number} x */
function f(x) {
    return x+1;
}

Expected behavior:

/** @param {number} x */
function f(x: number) {
    return x+1;
}

Actual behavior:

/** @param {number} x */
function f(x: number) {
    return x + 1;
}

Inferring the type from usage does not have this problem, so we could probably reuse some code from there.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptFixedA PR has been merged for this issue

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions