Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Incorrect indentation #3436

Copy link
Copy link
@mhegazy

Description

@mhegazy
Issue body actions

Reported by @kuon in:microsoft/TypeScript-Sublime-Plugin#220

When I use autoformat, the following block get the following indentation:

toolsElement = h.div({ className: "row-tools" },
    h.button({
        className: "add-node",
        onClick: () => DataController.createNode(this.props.parentId)
    }, "Create new node")
    );

While I expect (Last line should be to the left):

toolsElement = h.div({ className: "row-tools" },
    h.button({
        className: "add-node",
        onClick: () => DataController.createNode(this.props.parentId)
    }, "Create new node")
);

Another example:

return (
    h.div({
        className: "view-node-row",
        style: {
            width: width,
            height: rowHeight
        }
    },
        backgroundElement,
        centerElement,
        toolsElement,
        h.div({ className: "nodes" }, items)
        )
    );

While I expect:

return (
    h.div({
        className: "view-node-row",
        style: {
            width: width,
            height: rowHeight
        }
    },
    backgroundElement,
    centerElement,
    toolsElement,
    h.div({ className: "nodes" }, items)
    )
);

PS: I'm doing react without JSX because TypeScript > JSX, but proper indentation is really crucial to readability.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptA bug in TypeScriptFixedA PR has been merged for this issueA PR has been merged for this issue

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.