# Fix auto-indent for braceless if/for/while in TypeScript \(\#60708\) · gitcafe/zed

[View on GitCafe](https://git.cafe/gitcafe/zed/commit/1a246efd7e1b83ab568ec5e3e6c1a43a42e1abba)

Repository: [gitcafe/zed](https://git.cafe/gitcafe/zed)

Visibility: public

Requested revision: 1a246efd7e1b83ab568ec5e3e6c1a43a42e1abba

Requested commit: 1a246efd7e1b83ab568ec5e3e6c1a43a42e1abba

Commit: 1a246efd7e1b83ab568ec5e3e6c1a43a42e1abba

Tree: 4107f635b7e5674a13877696d2b1a34abe6e1d34

Author: Apoorva Verma

Committer: GitHub

## Message

```
Fix auto-indent for braceless if/for/while in TypeScript (#60708)

type `if (true)`, hit enter, nothing indents. same for for/while.

12aa270 commented these out to stop allman braces over-indenting
(#24976). fixed that, broke this. put them back with an optional `@end`
on the `{}` body so braced blocks stop before the brace and braceless
ones indent. same in tsx.

Fixes #60371.

Release Notes:

- Fixed TypeScript and TSX not auto-indenting the body of a braceless
`if`, `for`, or `while`

---------

Co-authored-by: Nathan Sobo <nathan@zed.dev>
```

## Parents

- [367cd759636225affd1df3d10afc1199dbbb56e7](https://git.cafe/gitcafe/zed/commit/367cd759636225affd1df3d10afc1199dbbb56e7?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zed/tree/1a246efd7e1b83ab568ec5e3e6c1a43a42e1abba?format=markdown)
