palantir / tslint-react

:orange_book: Lint rules related to React & JSX for TSLint.
Apache License 2.0
749 stars 76 forks source link

jsx-alignment is slightly incompatible with VS Code auto-format #62

Closed punya-asapp closed 7 years ago

punya-asapp commented 7 years ago

VS Code's auto-format yields

          <AutosizeInput
            onChange={onNameChange}
            placeholder="Name your project"
            placeholderIsMinWidth={true}
            value={props.name}
            />

But jsx-alignment wants

          <AutosizeInput
            onChange={onNameChange}
            placeholder="Name your project"
            placeholderIsMinWidth={true}
            value={props.name}
          />

Note that the last line is off by $indent spaces.

Is there a way to configure either VS Code or TSLint to make the two match up? I don't have a preference about which of the two conventions gets used.

Thanks for your time!

lvillani commented 7 years ago

@punya-asapp I think this is no longer the case with the latest versions of VSCode. I'm using 1.11.1 and if I put the closing tag aligned with the left angle bracket it stays there even if I manually trigger a format action.

(Btw, I believe that this is not a bug in tslint-react itself but in the editor instead).

punya-asapp commented 7 years ago

Thanks for looking into it, and please feel free to close out the ticket. On Tue, Apr 11, 2017 at 4:51 AM Lorenzo Villani notifications@github.com wrote:

@punya-asapp https://github.com/punya-asapp I think this is no longer the case with the latest versions of VSCode. I'm using 1.11.1 and if I put the closing tag aligned with the left angle bracket it stays there even if I manually trigger a format action.

(Btw, I believe that this is not a bug in tslint-react itself but in the editor instead).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/palantir/tslint-react/issues/62#issuecomment-293193477, or mute the thread https://github.com/notifications/unsubscribe-auth/AXZNjsf5WDTD4TypS4hnfaPPGZxu67wnks5ruz7-gaJpZM4Lp1Fx .