aboutsummaryrefslogtreecommitdiff
path: root/style.txt
diff options
context:
space:
mode:
authorFlorian Dold <florian.dold@gmail.com>2015-12-13 18:11:34 +0100
committerFlorian Dold <florian.dold@gmail.com>2015-12-13 18:11:34 +0100
commite370cd9ef673600199ad2581697c814e8e5ae414 (patch)
treedf7bf2d2bf210bef6593dbbf63f083cdfaca1f50 /style.txt
parentc9180a8b3c629c009a9ac33f353737f6dc1ab871 (diff)
downloadwallet-core-e370cd9ef673600199ad2581697c814e8e5ae414.tar.xz
Coding style
Diffstat (limited to 'style.txt')
-rw-r--r--style.txt23
1 files changed, 23 insertions, 0 deletions
diff --git a/style.txt b/style.txt
new file mode 100644
index 000000000..205bc5d83
--- /dev/null
+++ b/style.txt
@@ -0,0 +1,23 @@
+Javascript style
+================
+
+Basics:
+- Indent with 2 spaces.
+- Keep a maximum line length of 120 characters.
+- Never omit optional semicolons.
+- Do not put opening braces or brackets on a new line.
+- Call functions without spaces: foo(bar)
+- Use 'let' instead of 'var' whenever possible.
+- Declare "use strict;".
+- Use rocket (=>) syntax for anonymous functions. If an anonymous function is
+ too long, make it a named function.
+- Document functions with JSDoc comments (http://usejsdoc.org).
+
+Names:
+- Use PascalCase for classes/types, camelCase for variables, functions and
+ properties, UPPER_SNAKE_CASE for constants, kebab-case for event names.
+- Only capitalize the first letter of an acronym in identifiers.
+
+
+APIs:
+- Prefer 'Promise' to one-shot continuations whenever possible.