Skip to content

Commit f1e6417

Browse files
authored
chore: bump typescript to 4.6.2 (#1239)
1 parent df88ce8 commit f1e6417

File tree

85 files changed

+445
-379
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+445
-379
lines changed

package-lock.json

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

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,9 +138,9 @@
138138
"tar": "^6.0.1",
139139
"tar-fs": "^2.1.0",
140140
"tmp-promise": "^3.0.2",
141-
"ts-node": "^9.1.1",
141+
"ts-node": "^10.7.0",
142142
"ts-sinon": "^1.2.0",
143-
"typescript": "^4.2.4",
143+
"typescript": "^4.6.2",
144144
"uuid": "^3.3.3",
145145
"which": "^2.0.2",
146146
"yaml": "^1.10.0"

packages/async-rewriter2/src/async-writer-babel.spec.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('AsyncWriter', () => {
100100
try {
101101
await runTranspiledCode('Promise.reject(42)');
102102
expect.fail('missed exception');
103-
} catch (err) {
103+
} catch (err: any) {
104104
expect(err).to.equal(42);
105105
}
106106
});
@@ -122,7 +122,7 @@ describe('AsyncWriter', () => {
122122
try {
123123
runTranspiledCode("'use strict'; delete Object.prototype");
124124
expect.fail('missed exception');
125-
} catch (err) {
125+
} catch (err: any) {
126126
expect(err.name).to.equal('TypeError');
127127
}
128128
});
@@ -864,7 +864,7 @@ describe('AsyncWriter', () => {
864864
try {
865865
await runTranspiledCode('(async () => { var foo; foo(); })()');
866866
expect.fail('missed exception');
867-
} catch (err) {
867+
} catch (err: any) {
868868
expect(err.message).to.equal('foo is not a function');
869869
}
870870
});
@@ -947,7 +947,7 @@ describe('AsyncWriter', () => {
947947
}
948948
})();`);
949949
expect.fail('missed exception');
950-
} catch (err) {
950+
} catch (err: any) {
951951
expect(err.message).to.equal('generic error');
952952
}
953953
});
@@ -1054,7 +1054,7 @@ describe('AsyncWriter', () => {
10541054
}
10551055
})();`);
10561056
expect.fail('missed exception');
1057-
} catch (err) {
1057+
} catch (err: any) {
10581058
expect(err.message).to.equal('uncatchable!');
10591059
}
10601060
});
@@ -1068,7 +1068,7 @@ describe('AsyncWriter', () => {
10681068
} catch { }
10691069
})();`);
10701070
expect.fail('missed exception');
1071-
} catch (err) {
1071+
} catch (err: any) {
10721072
expect(err.message).to.equal('uncatchable!');
10731073
}
10741074
});
@@ -1082,7 +1082,7 @@ describe('AsyncWriter', () => {
10821082
} catch { } finally { return; }
10831083
})();`);
10841084
expect.fail('missed exception');
1085-
} catch (err) {
1085+
} catch (err: any) {
10861086
expect(err.message).to.equal('uncatchable!');
10871087
}
10881088
});
@@ -1096,7 +1096,7 @@ describe('AsyncWriter', () => {
10961096
} finally { return; }
10971097
})();`);
10981098
expect.fail('missed exception');
1099-
} catch (err) {
1099+
} catch (err: any) {
11001100
expect(err.message).to.equal('uncatchable!');
11011101
}
11021102
});
@@ -1114,7 +1114,7 @@ describe('AsyncWriter', () => {
11141114
}
11151115
})();`);
11161116
expect.fail('missed exception');
1117-
} catch (err) {
1117+
} catch (err: any) {
11181118
expect(err.message).to.equal('uncatchable!');
11191119
}
11201120
});

packages/async-rewriter2/src/async-writer-babel.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ export default class AsyncWriter {
7171
{ customErrorBuilder: babel.types.identifier('MongoshAsyncWriterError') }
7272
]
7373
], { code: true, ast: false })?.code as string;
74-
} catch (e) {
74+
} catch (e: any) {
7575
e.message = e.message.replace('unknown: ', '');
7676
throw e;
7777
}

packages/browser-repl/src/components/utils/inspect.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ function tryAddInspect(obj: any, stringifier: (this: any, depth: any, options: a
2323
value: function(...args: [any, any]) {
2424
try {
2525
return stringifier.call(this, ...args);
26-
} catch (err) {
26+
} catch (err: any) {
2727
console.warn('Could not inspect bson object', { obj: this, err });
2828
return utilInspect(this, { customInspect: false });
2929
}
3030
}
3131
});
32-
} catch (err) {
32+
} catch (err: any) {
3333
console.warn('Could not add inspect key to object', { obj, err });
3434
}
3535
}

packages/build/src/barque.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ describe('Barque', () => {
7777
let releasedUrls;
7878
try {
7979
releasedUrls = await barque.releaseToBarque(variant, url);
80-
} catch (err) {
80+
} catch (err: any) {
8181
if (process.platform === 'win32' && err.message.includes('ENOENT')) {
8282
return; // Cannot spawn the fake curator on Windows
8383
}
@@ -99,7 +99,7 @@ describe('Barque', () => {
9999

100100
try {
101101
await barque.releaseToBarque('debian-x64', debUrl);
102-
} catch (error) {
102+
} catch (error: any) {
103103
expect(error.message).to.include(`Curator is unable to upload ${debUrl},ubuntu1804,amd64 to barque`);
104104
expect(barque.createCuratorDir).to.have.been.called;
105105
expect(barque.extractLatestCurator).to.have.been.called;
@@ -114,7 +114,7 @@ describe('Barque', () => {
114114
config.platform = 'macos';
115115
try {
116116
barque = new Barque(config);
117-
} catch (e) {
117+
} catch (e: any) {
118118
expect(e.message).to.contain('only supported on linux');
119119
return;
120120
}
@@ -139,7 +139,7 @@ describe('Barque', () => {
139139
let accessErr: Error | undefined = undefined;
140140
try {
141141
await fs.access(curatorDirPath);
142-
} catch (e) {
142+
} catch (e: any) {
143143
accessErr = e;
144144
}
145145
expect(accessErr).to.be.undefined;
@@ -192,7 +192,7 @@ describe('Barque', () => {
192192
'https://repo.mongodb.org/apt/dist/package1.deb',
193193
'https://repo.mongodb.org/apt/dist/package2.deb',
194194
], 5, 1);
195-
} catch (e) {
195+
} catch (e: any) {
196196
expect(e.message).to.contain('the following packages are still not available');
197197
expect(e.message).to.contain('package2.deb');
198198
}
@@ -234,7 +234,7 @@ describe('Barque', () => {
234234
let accessErr: Error | undefined = undefined;
235235
try {
236236
await fs.access(curatorPath);
237-
} catch (e) {
237+
} catch (e: any) {
238238
accessErr = e;
239239
}
240240
expect(accessErr).to.be.undefined;

packages/build/src/barque.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export class Barque {
173173
});
174174
console.info(`Result for curator with ${args.join(' ')}`, result);
175175
return this.computePublishedPackageUrl(ppa, architecture, version, edition, packageUrl);
176-
} catch (error) {
176+
} catch (error: any) {
177177
console.error(`Curator with ${args.join(' ')} failed`, error);
178178
throw new Error(`Curator is unable to upload ${packageUrl},${ppa},${architecture} to barque ${error}`);
179179
}

packages/build/src/evergreen/artifacts.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('evergreen artifacts', () => {
2626
'wrong',
2727
tmpDir
2828
);
29-
} catch (e) {
29+
} catch (e: any) {
3030
return expect(e).to.not.be.undefined;
3131
}
3232
expect.fail('Expected error');

packages/build/src/evergreen/rest-api.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ describe('evergreen rest-api', () => {
3030
it('throws an error when the configuration file does not exist', async() => {
3131
try {
3232
await EvergreenApi.fromUserConfiguration('kasldjflasjk dfalsd jfsdfk');
33-
} catch (e) {
33+
} catch (e: any) {
3434
expect(e.message).to.contain('Could not find local evergreen configuration');
3535
return;
3636
}
@@ -46,7 +46,7 @@ describe('evergreen rest-api', () => {
4646
const configFile = await writeEvergreenConfiguration(YAML.stringify(data));
4747
try {
4848
await EvergreenApi.fromUserConfiguration(configFile);
49-
} catch (e) {
49+
} catch (e: any) {
5050
expect(e.message).to.contain(key);
5151
}
5252
});
@@ -131,7 +131,7 @@ describe('evergreen rest-api', () => {
131131

132132
try {
133133
await api.getTasks('mongosh', 'sha');
134-
} catch (e) {
134+
} catch (e: any) {
135135
expect(e.message).to.equal('Unexpected response status: 404 - ERR: Not found');
136136
return;
137137
}

packages/build/src/git/repository-status.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ describe('git repository-status', () => {
4444
getRepositoryStatus.returns(status);
4545
try {
4646
verifyGitStatus('root', getRepositoryStatus, spawnSync);
47-
} catch (e) {
47+
} catch (e: any) {
4848
expect(e.message).to.contain('Could not determine local repository information');
4949
return;
5050
}
@@ -64,7 +64,7 @@ describe('git repository-status', () => {
6464
getRepositoryStatus.returns(status);
6565
try {
6666
verifyGitStatus('root', getRepositoryStatus, spawnSync);
67-
} catch (e) {
67+
} catch (e: any) {
6868
expect(e.message).to.contain('The current branch does not match');
6969
return;
7070
}
@@ -84,7 +84,7 @@ describe('git repository-status', () => {
8484
getRepositoryStatus.returns(status);
8585
try {
8686
verifyGitStatus('root', getRepositoryStatus, spawnSync);
87-
} catch (e) {
87+
} catch (e: any) {
8888
expect(e.message).to.contain('The branch you are on is not tracking any remote branch.');
8989
return;
9090
}
@@ -104,7 +104,7 @@ describe('git repository-status', () => {
104104
getRepositoryStatus.returns(status);
105105
try {
106106
verifyGitStatus('root', getRepositoryStatus, spawnSync);
107-
} catch (e) {
107+
} catch (e: any) {
108108
expect(e.message).to.contain('Your local repository is not clean or diverged from the remote branch');
109109
return;
110110
}
@@ -124,7 +124,7 @@ describe('git repository-status', () => {
124124
getRepositoryStatus.returns(status);
125125
try {
126126
verifyGitStatus('root', getRepositoryStatus, spawnSync);
127-
} catch (e) {
127+
} catch (e: any) {
128128
expect(e.message).to.contain('Your local repository is not clean or diverged from the remote branch');
129129
return;
130130
}
@@ -144,7 +144,7 @@ describe('git repository-status', () => {
144144
getRepositoryStatus.returns(status);
145145
try {
146146
verifyGitStatus('root', getRepositoryStatus, spawnSync);
147-
} catch (e) {
147+
} catch (e: any) {
148148
expect(e.message).to.contain('You have local tags that are not pushed to the remote');
149149
return;
150150
}

0 commit comments

Comments
 (0)