-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Adds indent option #2165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adds indent option #2165
Conversation
…on of the compiler.
timer is started. If timer finishes before another change takes place, project structure will be updated to reflect any changes in reference comments or import statements.
…he parser as such.
Hi @tinganho, I'm your friendly neighborhood Microsoft Pull Request Bot (You can call me MSBOT). Thanks for your contribution! TTYL, MSBOT; |
@tinganho, Thanks for signing the contribution license agreement so quickly! Actual humans will now validate the agreement and then evaluate the PR. |
Thanks for the Pull Request. We have not exposed control flags for the style of the generated code. This applies to indent, placing curlies on their own line, spacing, splitting statements, maintaining semicolons, etc... We recommend using a code beautifier as a post build step instead. I do not think we would want to add additional flags for different output code formatting options and maintain them going forward; the additional complexity in the compiler would not be worth the value add to most of our customers. |
@mhegazy It would be good to have the style config to include newline types too. I kind of don't like that the compiler compiles windows new lines instead of unix ones. |
We have an issue for that: #1693. We would be open to take a PR for this since it is not just a style option but can affect other tools down stream in your build tool chain. |
I've tried to add indent option to
tsc
.So
tsc
have the option--indentSize [size]
wheresize
can be 2 or 4.I haven't fixed test cases. It would be good if someone could guide me through it. I was very hard to follow what is going on. I don't even get a diff of what went wrong. And I've noticed that there are significant white space issues on many source files. Like spaces occurring at the end of line and unix line breaks appearing with windows linebreaks.