mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-07-05 21:23:37 -05:00
Merge branch 'master' of https://github.com/Microsoft/TypeScript-wiki
@@ -26,7 +26,7 @@ These guidelines are mainly **meant for contributors to the TypeScript project**
|
||||
4. Within a file, type definitions should come first.
|
||||
|
||||
## `null` and `undefined`
|
||||
1. Use **undefined**, do not use null.
|
||||
1. Use **undefined**. Do not use null.
|
||||
|
||||
## General Assumptions
|
||||
1. Consider objects like Nodes, Symbols, etc. as immutable outside the component that created them. Do not change them.
|
||||
@@ -84,4 +84,4 @@ For a variety of reasons, we avoid certain constructs, and use some of our own.
|
||||
3. `function f(x: number, y: string): void { }`
|
||||
6. Use a single declaration per variable statement <br />(i.e. use `var x = 1; var y = 2;` over `var x = 1, y = 2;`).
|
||||
7. `else` goes on a separate line from the closing curly brace.
|
||||
8. Use 4 spaces per indentation.
|
||||
8. Use 4 spaces per indentation.
|
||||
|
||||
@@ -114,7 +114,7 @@ TypeScript 2.3 adds support for declaring defaults for generic type parameters.
|
||||
|
||||
#### Example
|
||||
|
||||
Consider a function that creates a new `HTMLElement`, calling it with no arguments generats an `Div`; you can optionally pass a list of children as well. Previously you would have to define it as:
|
||||
Consider a function that creates a new `HTMLElement`, calling it with no arguments generates a `Div`; you can optionally pass a list of children as well. Previously you would have to define it as:
|
||||
|
||||
```ts
|
||||
declare function create(): Container<HTMLDivElement, HTMLDivElement[]>;
|
||||
@@ -2611,7 +2611,7 @@ f2({ x: 1, y: 1 });
|
||||
|
||||
## Support for decorators when targeting ES3
|
||||
|
||||
Decorators are now allowed when targeting ES3. TypeScript 1.7 removes the ES5-specific use of `reduceRight` from the `__decorate` helper. The changes also inline calls `Object.getOwnPropertyDescriptor` and `Object.defineProperty` in a backwards-compatible fashion that allows for a to clean up the emit for ES5 and later by removing various repetitive calls to the aforementioned `Object` methods.
|
||||
Decorators are now allowed when targeting ES3. TypeScript 1.7 removes the ES5-specific use of `reduceRight` from the `__decorate` helper. The changes also inline calls to `Object.getOwnPropertyDescriptor` and `Object.defineProperty` in a backwards-compatible fashion that allows for clean up of the emit for ES5 and later by removing various repetitive calls to the aforementioned `Object` methods.
|
||||
|
||||
|
||||
# TypeScript 1.6
|
||||
|
||||
Reference in New Issue
Block a user