Skip to content

Incorrect indentation #220

Closed
Closed

Description

@kuon

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.

Activity

  1. zhengbli commented on Jun 8, 2015

    @zhengbli
    Contributor

    Mohamed Hegazy (@mhegazy) could you take a look at the formatting issue? Is that a known problem?

  2. mhegazy commented on Jun 9, 2015

    @mhegazy
    Contributor

    I have ported this to the TS repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions