forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/master'
* upstream/master: Document contribution to the code along with coding standards (#321)
- Loading branch information
Showing
6 changed files
with
161 additions
and
45 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## Coding guidelines for TypeScript | ||
* The following standards are inspired from [Coding guidelines for TypeScript](https://github.com/Microsoft/TypeScript/wiki/Coding-guidelines). | ||
|
||
### Names | ||
* Use PascalCase for type names. | ||
* Use "I" as a prefix for interface names only when an interface is implemented by a class. | ||
* Use PascalCase for enum values. | ||
* Use camelCase for function names. | ||
* Use camelCase for property names and local variables. | ||
* Do not use "_" as a prefix for private properties (unless used as backing properties). | ||
* Use whole words in names when possible. | ||
|
||
### Types | ||
|
||
* Do not export types/functions unless you need to share it across multiple components. | ||
* Do not introduce new types/values to the global namespace. | ||
* Shared types should be defined in 'types.ts'. | ||
Within a file, type definitions should come first. | ||
|
||
### null and undefined | ||
|
||
Use undefined. Do not use null. | ||
|
||
### Comments | ||
|
||
Use JSDoc style comments for functions, interfaces, enums, and classes. | ||
|
||
### Strings | ||
|
||
Use single quotes for strings. | ||
|
||
### Style | ||
|
||
* Use arrow functions over anonymous function expressions. | ||
* Always surround loop and conditional bodies with curly braces. Statements on the same line are allowed to omit braces. | ||
* Open curly braces always go on the same line as whatever necessitates them. | ||
* Parenthesized constructs should have no surrounding whitespace. | ||
* A single space follows commas, colons, and semicolons in those constructs. For example: | ||
* `for (var i = 0, n = str.length; i < 10; i++) { }` | ||
* `if (x < 10) { }` | ||
* `function f(x: number, y: string): void { }` | ||
|
||
* `else` goes on a the same line from the closing curly brace. | ||
* Use 4 spaces per indentation. | ||
|
||
|
This file contains 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
This file contains 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