Skip to content

Commit d661cfb

Browse files
committed
style: add space before types
1 parent 3ecda60 commit d661cfb

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

code/async-await/es5/asyncAwaitES5.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async function dramaticWelcome(): Promise<void> {
1212

1313
for (let i = 0; i < 5; i++) {
1414
// await is converting Promise<number> into number
15-
const count:number = await delay(500, i);
15+
const count: number = await delay(500, i);
1616
console.log(count);
1717
}
1818

code/async-await/es6/asyncAwaitES6.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ async function dramaticWelcome(): Promise<void> {
1212

1313
for (let i = 0; i < 5; i++) {
1414
// await is converting Promise<number> into number
15-
const count:number = await delay(500, i);
15+
const count: number = await delay(500, i);
1616
console.log(count);
1717
}
1818

code/tips/mixins.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ interface ActivatibleDisposible extends Disposable, Activatable {
2222
new (): ActivatibleDisposible;
2323
}
2424

25-
var ActivatibleDisposible:ActivatibleDisposible = <any>(function(){
25+
var ActivatibleDisposible: ActivatibleDisposible = <any>(function(){
2626
Disposable.apply(this);
2727
ActivatibleDisposible.apply(this);
2828
return this;

docs/async-await.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ async function dramaticWelcome(): Promise<void> {
7171

7272
for (let i = 0; i < 5; i++) {
7373
// await is converting Promise<number> into number
74-
const count:number = await delay(500, i);
74+
const count: number = await delay(500, i);
7575
console.log(count);
7676
}
7777

docs/styleguide/styleguide.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,11 @@ enum Color {
163163
164164
**Bad**
165165
```ts
166-
let foo = {x:123,y:undefined};
166+
let foo = { x: 123, y: undefined };
167167
```
168168
**Good**
169169
```ts
170-
let foo:{x:number,y?:number} = {x:123};
170+
let foo: { x: number, y?: number } = { x:123 };
171171
```
172172

173173
* Use `undefined` in general (do consider returning an object like `{valid:boolean, value?:Foo}` instead)

docs/tips/create-arrays.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
Creating an empty array is super easy:
44

55
```ts
6-
const foo:string[] = [];
6+
const foo: string[] = [];
77
```
88

99
If you want to create an array pre-filled with some content use the ES6 `Array.prototype.fill`:
1010

1111
```ts
12-
const foo:string[] = new Array(3).fill('');
12+
const foo: string[] = new Array(3).fill('');
1313
console.log(foo); // ['','',''];
1414
```
1515

docs/types/index-signatures.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ An `Object` in JavaScript (and hence TypeScript) can be accessed with a **string
55
Here is a quick example:
66

77
```ts
8-
let foo:any = {};
8+
let foo: any = {};
99
foo['Hello'] = 'World';
1010
console.log(foo['Hello']); // World
1111
```
@@ -20,7 +20,7 @@ class Foo {
2020
}
2121
}
2222

23-
let foo:any = {};
23+
let foo: any = {};
2424
foo['Hello'] = new Foo('World');
2525
foo['Hello'].log(); // World
2626
```
@@ -35,7 +35,7 @@ let obj = {
3535
}
3636
}
3737

38-
let foo:any = {};
38+
let foo: any = {};
3939
foo[obj] = 'World'; // toString called
4040
console.log(foo[obj]); // toString called, World
4141
console.log(foo['Hello']); // World
@@ -63,7 +63,7 @@ let obj = {
6363
}
6464
}
6565

66-
let foo:any = {};
66+
let foo: any = {};
6767

6868
// ERROR: the index signature must be string, number ...
6969
foo[obj] = 'World';
@@ -76,7 +76,7 @@ The reason for forcing the user to be explicit is because the default `toString`
7676

7777
```ts
7878
let obj = {message:'Hello'}
79-
let foo:any = {};
79+
let foo: any = {};
8080

8181
// ERROR: the index signature must be string, number ...
8282
foo[obj] = 'World';

docs/types/readonly.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ type Foo = {
5252

5353
type FooReadonly = Readonly<Foo>;
5454

55-
let foo:Foo = {bar: 123, bas: 456};
56-
let fooReadonly:FooReadonly = {bar: 123, bas: 456};
55+
let foo: FOO = {bar: 123, bas: 456};
56+
let fooReadonly: FooReadonly = {bar: 123, bas: 456};
5757

5858
foo.bar = 456; // Okay
5959
fooReadonly.bar = 456; // ERROR: bar is readonly

docs/types/type-assertion.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ interface Foo {
7474
bar: number;
7575
bas: string;
7676
}
77-
var foo:Foo = {
77+
var foo: FOO = {
7878
// the compiler will provide autocomplete for properties of Foo
7979
};
8080
```

0 commit comments

Comments
 (0)