Last active
July 7, 2023 05:29
-
-
Save jckeen/68e78863be019eb84827904d36c7a196 to your computer and use it in GitHub Desktop.
Angular 2 TypeScript Code Style For WebStorm
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
These are code style settings, based off the Style Guide for Angular 2: | |
https://angular.io/docs/ts/latest/guide/style-guide.html | |
WebStorm does not currently reformat code based off of tslint.json settings. | |
This is an attempt to set TypeScript settings for Code Style to follow the Style Guide. | |
I will update this as I find differences. | |
To Import: Settings > Editor > Code Style > Import | |
--> | |
<code_scheme name="Angular 2"> | |
<TypeScriptCodeStyleSettings> | |
<option name="USE_DOUBLE_QUOTES" value="false" /> | |
<option name="SPACES_WITHIN_OBJECT_LITERAL_BRACES" value="true" /> | |
<option name="SPACES_WITHIN_IMPORTS" value="true" /> | |
</TypeScriptCodeStyleSettings> | |
<codeStyleSettings language="TypeScript"> | |
<option name="SPACE_WITHIN_BRACKETS" value="true" /> | |
</codeStyleSettings> | |
</code_scheme> |
Please add indent options
<codeStyleSettings language="TypeScript">
<option name="SPACE_WITHIN_BRACKETS" value="true" />
<indentOptions>
<option name="INDENT_SIZE" value="2" />
<option name="CONTINUATION_INDENT_SIZE" value="2" />
<option name="TAB_SIZE" value="2" />
</indentOptions>
</codeStyleSettings>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
hello, did you updated this code? or did you found another more completed?
actually webstorm reformat code like this:
and style code is like this: