Skip to content

Commit 741a136

Browse files
committed
feat(TS): Update to TypeScript 3.5.3
- Uses `unknown` type instead of `{}` per TS 3 - Updates dtslint tests where certain things are now working better BREAKING CHANGE: RxJS requires TS 3.5
1 parent 8c32ed0 commit 741a136

19 files changed

+1827
-2825
lines changed

package-lock.json

Lines changed: 1790 additions & 2778 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,11 +137,11 @@
137137
"check-side-effects": "0.0.20",
138138
"color": "3.0.0",
139139
"colors": "1.1.2",
140-
"commitizen": "^3.1.1",
140+
"commitizen": "^4.0.3",
141141
"cross-env": "5.1.3",
142142
"cz-conventional-changelog": "1.2.0",
143-
"dependency-cruiser": "^4.17.0",
144-
"dtslint": "0.7.4",
143+
"dependency-cruiser": "^4.27.3",
144+
"dtslint": "^0.7.4",
145145
"escape-string-regexp": "1.0.5",
146146
"eslint": "4.17.0",
147147
"eslint-plugin-jasmine": "^2.10.1",
@@ -152,8 +152,8 @@
152152
"google-closure-compiler-js": "20170218.0.0",
153153
"gzip-size": "4.1.0",
154154
"klaw-sync": "3.0.2",
155-
"lint-staged": "^9.2.5",
156-
"lodash": "^4.17.11",
155+
"lint-staged": "^8.1.6",
156+
"lodash": "^4.17.15",
157157
"minimist": "1.2.0",
158158
"mkdirp": "0.5.1",
159159
"mocha": "5.0.0",
@@ -177,7 +177,7 @@
177177
"tslint-etc": "1.5.0",
178178
"tslint-no-toplevel-property-access": "0.0.2",
179179
"tslint-no-unused-expression-chai": "0.0.3",
180-
"typescript": "^3.0.1",
180+
"typescript": "3.5.3",
181181
"validate-commit-msg": "2.14.0",
182182
"webpack": "^4.31.0"
183183
},

spec-dtslint/Observable-spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ describe('pipe', () => {
7474
const o = of('foo').pipe(a('1'), a('2'), a('3'), a('4'), a('5'), a('6'), a('7'), a('8'), a('9')); // $ExpectType Observable<"9">
7575
});
7676

77-
it('should infer {} for more than 9 arguments', () => {
78-
const o = of('foo').pipe(a('1'), a('2'), a('3'), a('4'), a('5'), a('6'), a('7'), a('8'), a('9'), a('10')); // $ExpectType Observable<{}>
77+
it('should infer unknown for more than 9 arguments', () => {
78+
const o = of('foo').pipe(a('1'), a('2'), a('3'), a('4'), a('5'), a('6'), a('7'), a('8'), a('9'), a('10')); // $ExpectType Observable<unknown>
7979
});
8080

8181
it('should require a type assertion for more than 9 arguments', () => {
@@ -119,7 +119,7 @@ describe('pipe', () => {
119119
});
120120

121121
it('should not enforce types beyond the 9th argument', () => {
122-
const o = of('foo').pipe(a('1'), a('2'), a('3'), a('4'), a('5'), a('6'), a('7'), a('8'), a('9'), a('#', '10')); // $ExpectType Observable<{}>
122+
const o = of('foo').pipe(a('1'), a('2'), a('3'), a('4'), a('5'), a('6'), a('7'), a('8'), a('9'), a('#', '10')); // $ExpectType Observable<unknown>
123123
});
124124

125125
it('should support operators that return generics', () => {

spec-dtslint/observables/combineLatest-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ it('should accept 6 params', () => {
4040
const o = combineLatest(a, b, c, d, e, f); // $ExpectType Observable<[A, B, C, D, E, F]>
4141
});
4242

43-
it('should result in Observable<{}> for 7 or more params', () => {
44-
const o = combineLatest(a, b, c, d, e, f, g); // $ExpectType Observable<{}>
43+
it('should result in Observable<unknown> for 7 or more params', () => {
44+
const o = combineLatest(a, b, c, d, e, f, g); // $ExpectType Observable<unknown>
4545
});
4646

4747
it('should accept union types', () => {

spec-dtslint/observables/concat-spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ it('should accept more than 6 params', () => {
2828
const o = concat(of(1), of(2), of(3), of(4), of(5), of(6), of(7), of(8), of(9)); // $ExpectType Observable<number>
2929
});
3030

31-
it('should return Observable<{}> for more than 6 different types of params', () => {
32-
const o = concat(of(1), of('a'), of(2), of(true), of(3), of([1, 2, 3]), of(4)); // $ExpectType Observable<{}>
31+
it('should return Observable<unknown> for more than 6 different types of params', () => {
32+
const o = concat(of(1), of('a'), of(2), of(true), of(3), of([1, 2, 3]), of(4)); // $ExpectType Observable<unknown>
3333
});
3434

3535
it('should accept scheduler after params', () => {

spec-dtslint/observables/race-spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ describe('race(a, b, c)', () => {
4747
const o = race(a, a, a, a, a, a, a, a, a, a, a, a, a, a); // $ExpectType Observable<number>
4848
});
4949

50-
it('should return {} for 6 or more arguments of different types', () => {
50+
it('should return unknown for 6 or more arguments of different types', () => {
5151
const a = of(1);
5252
const b = of('a');
5353
const c = of(true);
5454
const d = of([1, 2, 3]);
5555
const e = of(['blah']);
5656
const f = of({ foo: 'bar' });
57-
const o = race(a, b, c, d, e, f); // $ExpectType Observable<{}>
57+
const o = race(a, b, c, d, e, f); // $ExpectType Observable<unknown>
5858
});
5959
});
6060

@@ -107,7 +107,7 @@ describe('race([a, b, c])', () => {
107107
const d = of([1, 2, 3]);
108108
const e = of(['blah']);
109109
const f = of({ foo: 'bar' });
110-
const o = race([a, b, c, d, e, f]); // $ExpectType Observable<{}>
110+
const o = race([a, b, c, d, e, f]); // $ExpectType Observable<unknown>
111111
});
112112
});
113113

spec-dtslint/operators/distinct-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ it('should infer correctly', () => {
77

88
it('should accept a keySelector', () => {
99
interface Person { name: string; }
10-
const o = of<Person>({ name: 'Tim' }).pipe(distinct(person => person.name)); // $ExpectType Observable<Person>
10+
const o = of({ name: 'Tim' } as Person).pipe(distinct(person => person.name)); // $ExpectType Observable<Person>
1111
});
1212

1313
it('should accept flushes', () => {

spec-dtslint/operators/filter-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,5 +55,5 @@ it('should support inference from a return type with Boolean as a predicate', ()
5555
}
5656

5757
const i$: Observable<I> = of();
58-
const s$: Observable<string> = i$.pipe(map(i => i.a), filter(Boolean)); // $ExpectType Observable<string>
58+
const s$ = i$.pipe(map(i => i.a), filter(Boolean)); // $ExpectType Observable<string>
5959
});

spec-dtslint/operators/onErrorResumeNext-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ it('should accept six inputs', () => {
4343
});
4444

4545
it('should accept seven and more inputs', () => {
46-
const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1), of(2), of('3'), of('4'), of(5), of('6'), of(7))); // $ExpectType Observable<string | {}>
46+
const o = of('apple', 'banana', 'peach').pipe(onErrorResumeNext(of(1), of(2), of('3'), of('4'), of(5), of('6'), of(7))); // $ExpectType Observable<unknown>
4747
const p = of('apple', 'banana', 'peach').pipe(onErrorResumeNext<string, string | number>(of(1), of(2), of('3'), of('4'), of(5), of('6'), of(7))); // $ExpectType Observable<string | number>
4848
});
4949

spec-dtslint/operators/pluck-spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ it('should support nested object of 6 layer depth', () => {
2626
});
2727

2828
it('should support nested object of more than 6 layer depth', () => {
29-
const a = of({ a: { b: { c: { d: { e: { f: { name: 'abc' } } } } } } }).pipe(pluck('a', 'b', 'c', 'd', 'e', 'f', 'name')); // $ExpectType Observable<{}>
29+
const a = of({ a: { b: { c: { d: { e: { f: { name: 'abc' } } } } } } }).pipe(pluck('a', 'b', 'c', 'd', 'e', 'f', 'name')); // $ExpectType Observable<unknown>
3030
});
3131

3232
it('should accept existing keys only', () => {

0 commit comments

Comments
 (0)