diff options
author | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-17 16:32:28 +0200 |
---|---|---|
committer | wolfbeast <mcwerewolf@wolfbeast.com> | 2020-04-17 16:32:28 +0200 |
commit | 38f206cb7288d8ef3f05e74e8201e9e662a0859a (patch) | |
tree | a490de810dbf0e9485f77305153486c6dd3f9994 /docs | |
parent | d5102d6beafc2a2a0cec3cc3ee5f7ebde31ae7bf (diff) | |
download | uxp-38f206cb7288d8ef3f05e74e8201e9e662a0859a.tar.gz |
[docs] Update coding style cf. discussion with Tobin.
Diffstat (limited to 'docs')
-rw-r--r-- | docs/UXP Coding Style.md | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/docs/UXP Coding Style.md b/docs/UXP Coding Style.md index 5dc4fd2a59..fc025584f0 100644 --- a/docs/UXP Coding Style.md +++ b/docs/UXP Coding Style.md @@ -126,7 +126,7 @@ switch (variable) { code_for_1; code_for_1; break; - case value2: + case value2: // Comment describing 2 (alternative) code_for_2; code_for_2; // fallthrough @@ -273,7 +273,7 @@ Applies to `*.js` and `*.jsm`. } }, false); ``` -- Use a single space between `{` `}` braces in empty js objects. +- Don't use a space between `{` `}` braces in empty js objects, `{` `}` braces in empty function scopes, or `[` `]` brackets in empty arrays. ### Flow control Flow control expressions should follow the following guidelines: @@ -343,7 +343,7 @@ switch (variable) { code_for_1; code_for_1; break; - case value2: + case value2: // Comment describing 2 (alternative) code_for_2; code_for_2; // fallthrough @@ -397,8 +397,7 @@ try { try { do_something(); -} catch(e) { -} +} catch(e) {} try { do_something(); @@ -414,11 +413,6 @@ try { // No error processing do_something_else(); } - -// No closing brace on its own line -try { - do_something(); -} catch(ex) { } ``` ### Long line wrapping |