diff options
author | Florian Dold <florian.dold@gmail.com> | 2016-02-29 18:03:02 +0100 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2016-02-29 18:03:02 +0100 |
commit | c962e9402123900c53967c14cf809ea10576cdb8 (patch) | |
tree | e7df9cfdd6fceae30fb99c8ec6be5e07c8b153a8 /style.txt | |
parent | 30ee3320c788129b258ed8b42f4fc63d28431e2f (diff) | |
download | wallet-core-c962e9402123900c53967c14cf809ea10576cdb8.tar.xz |
restructure
Diffstat (limited to 'style.txt')
-rw-r--r-- | style.txt | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/style.txt b/style.txt deleted file mode 100644 index d6d96cb7d..000000000 --- a/style.txt +++ /dev/null @@ -1,49 +0,0 @@ -TypeScript style -================ - -Basics: -- Indent with 2 spaces. -- Keep a maximum line length of 120 characters. -- Prefer "double quotes" for strings. -- 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. -- Use the strict equality operator (===). -- Document functions with JSDoc comments (http://usejsdoc.org). - - -JavaScript version: -Stick to ES6 features. Do not rely on any vendor-specific extensions (such as -Firefox often offers). ES6 features not yet supported by major browsers are -okay as long as there is a well-supported and reasonable polyfill (such as -babel) available. - - -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 (e.g. HttpResponseCode). - - -APIs: -- Prefer 'Promise' to one-shot continuations whenever possible. -- Prefer handlebars templates to poking around in the DOM. - - -Dependency Injection (DI): -DI is a useful pattern when components need to be replaced by mocks or have -multiple co-existing implementations. But DI also makes code overly generic, -bureaucratic and less readble. Only use DI if there is a definite need for it, -do not use it by default. Inject individual dependencies via class -constructors and avoid service locators. - - -Misc: -- Do not use ES6 template strings for constructing HTML, - use TSX/JSX literals instead. -- For everything not covered here, stick to this style guide: - https://github.com/airbnb/javascript. |