Skip to content

Commit

Permalink
Update to TypeScript 3.9 (#9012)
Browse files Browse the repository at this point in the history
* Update TS to 3.9
  • Loading branch information
xirzec authored Jun 1, 2020
1 parent f1a3359 commit ca526b6
Show file tree
Hide file tree
Showing 44 changed files with 237 additions and 222 deletions.
369 changes: 188 additions & 181 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion common/tools/eslint-plugin-azure-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"dependencies": {
"eslint-config-prettier": "^6.0.0",
"glob": "^7.1.2",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"tslib": "^1.10.0"
},
"devDependencies": {
Expand Down
1 change: 1 addition & 0 deletions dataplane.code-workspace
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@
"**/*.d.ts": true,
"**/test-browser/*": true
},
"typescript.tsdk": "core-http\\node_modules\\typescript\\lib",

},
"extensions": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/appconfiguration/app-configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"rollup-plugin-terser": "^5.1.1",
"sinon": "^9.0.2",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"uglify-js": "^3.4.9",
"@rollup/plugin-json": "^4.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/abort-controller/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,6 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"ts-node": "^8.3.0",
"typescript": "~3.8.3"
"typescript": "~3.9.3"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
"rollup-plugin-terser": "^5.1.1",
"sinon": "^9.0.2",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"ws": "^7.1.1"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-arm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"shx": "^0.3.2",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"uglify-js": "^3.4.9"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-asynciterator-polyfill/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,6 @@
"eslint-plugin-no-only-tests": "^2.3.0",
"eslint-plugin-promise": "^4.1.1",
"prettier": "^1.16.4",
"typescript": "~3.8.3"
"typescript": "~3.9.3"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^3.1.1",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@
"sinon": "^9.0.2",
"ts-loader": "^6.0.4",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"uglify-js": "^3.4.9",
"xhr-mock": "^2.4.1"
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-https/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^3.1.1",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-lro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^3.1.1",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"uglify-js": "^3.4.9"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-paging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@
"eslint-plugin-no-only-tests": "^2.3.0",
"eslint-plugin-promise": "^4.1.1",
"prettier": "^1.16.4",
"typescript": "~3.8.3"
"typescript": "~3.9.3"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^3.1.1",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/core/logger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,6 @@
"rollup-plugin-terser": "^5.1.1",
"sinon": "^9.0.2",
"ts-node": "^8.3.0",
"typescript": "~3.8.3"
"typescript": "~3.9.3"
}
}
2 changes: 1 addition & 1 deletion sdk/cosmosdb/cosmos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,6 @@
"tslint": "^5.0.0",
"tslint-config-prettier": "^1.14.0",
"typedoc": "^0.15.0",
"typescript": "~3.8.3"
"typescript": "~3.9.3"
}
}
2 changes: 1 addition & 1 deletion sdk/cosmosdb/cosmos/src/client/Container/Containers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ export class Containers {
};
}

const response = await this.clientContext.create<ContainerRequest>({
const response = await this.clientContext.create<ContainerRequest, ContainerDefinition>({
body,
path,
resourceType: ResourceType.container,
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"rollup-plugin-terser": "^5.1.1",
"sinon": "^9.0.2",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"ws": "^7.1.1"
}
}
2 changes: 1 addition & 1 deletion sdk/eventhub/event-processor-host/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-uglify": "^6.0.0",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"ws": "^7.1.1"
}
}
2 changes: 1 addition & 1 deletion sdk/eventhub/eventhubs-checkpointstore-blob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^3.1.1",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/eventhub/testhub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"rhea": "^1.0.21",
"rimraf": "^3.0.0",
"tslib": "^1.10.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"uuid": "^8.1.0",
"yargs": "^15.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/formrecognizer/ai-form-recognizer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"sinon": "^9.0.2",
"source-map-support": "^0.5.9",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"fs-extra": "^8.1.0",
"@types/fs-extra": "^8.0.0"
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/identity/identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^3.1.1",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-certificates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"sinon": "^9.0.2",
"source-map-support": "^0.5.9",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"uglify-js": "^3.4.9",
"url": "^0.11.0"
}
Expand Down
6 changes: 4 additions & 2 deletions sdk/keyvault/keyvault-certificates/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,10 @@ export {
/**
* Deprecated KeyVault copy of core-lro's PollerLike.
*/
export type KVPollerLike<TState extends PollOperationState<TResult>, TResult> = PollerLike<TState, TResult>;
export type KVPollerLike<TState extends PollOperationState<TResult>, TResult> = PollerLike<
TState,
TResult
>;

function toCoreAttributes(properties: CertificateProperties): CoreCertificateAttributes {
return {
Expand Down Expand Up @@ -2153,7 +2156,6 @@ export class CertificateClient {
const attributes: any = item.attributes || {};

const abstractProperties: any = {
name: parsedId.name,
createdOn: attributes.created,
updatedOn: attributes.updated,
expiresOn: attributes.expires,
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"sinon": "^9.0.2",
"source-map-support": "^0.5.9",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"uglify-js": "^3.4.9",
"url": "^0.11.0"
}
Expand Down
4 changes: 0 additions & 4 deletions sdk/keyvault/keyvault-keys/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1144,11 +1144,9 @@ export class KeyClient {
keyType: keyBundle.key ? keyBundle.key.kty : undefined,
properties: {
id: keyBundle.key ? keyBundle.key.kid : undefined,
name: parsedId.name,
expiresOn: attributes.expires,
createdOn: attributes.created,
updatedOn: attributes.updated,
vaultUrl: parsedId.vaultUrl,
...keyBundle,
...parsedId,
...attributes
Expand Down Expand Up @@ -1188,7 +1186,6 @@ export class KeyClient {

const abstractProperties: any = {
id: keyItem.kid,
name: parsedId.name,
deletedOn: (attributes as any).deletedDate,
expiresOn: attributes.expires,
createdOn: attributes.created,
Expand Down Expand Up @@ -1233,7 +1230,6 @@ export class KeyClient {
const resultObject: any = {
createdOn: attributes.created,
updatedOn: attributes.updated,
vaultUrl: parsedId.vaultUrl,
...keyItem,
...parsedId,
...keyItem.attributes
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-secrets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"sinon": "^9.0.2",
"source-map-support": "^0.5.9",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"uglify-js": "^3.4.9",
"url": "^0.11.0"
}
Expand Down
1 change: 0 additions & 1 deletion sdk/keyvault/keyvault-secrets/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -954,7 +954,6 @@ export class SecretClient {
value: secretBundle.value,
name: parsedId.name,
properties: {
vaultUrl: parsedId.vaultUrl,
expiresOn: (attributes as any).expires,
createdOn: (attributes as any).created,
updatedOn: (attributes as any).updated,
Expand Down
2 changes: 1 addition & 1 deletion sdk/search/search-documents/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"sinon": "^9.0.2",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/servicebus/service-bus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"ws": "^7.1.1"
}
}
2 changes: 1 addition & 1 deletion sdk/storage/storage-blob/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"source-map-support": "^0.5.9",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 2 additions & 0 deletions sdk/storage/storage-blob/src/utils/utils.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,8 @@ export function padStart(
targetLength: number,
padString: string = " "
): string {
// TS doesn't know this code needs to run downlevel sometimes.
// @ts-expect-error
if (String.prototype.padStart) {
return currentString.padStart(targetLength, padString);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-datalake/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"source-map-support": "^0.5.9",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 2 additions & 0 deletions sdk/storage/storage-file-datalake/src/utils/utils.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,8 @@ export function padStart(
targetLength: number,
padString: string = " "
): string {
// TS doesn't know this code needs to run downlevel sometimes.
// @ts-expect-error
if (String.prototype.padStart) {
return currentString.padStart(targetLength, padString);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-file-share/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"source-map-support": "^0.5.9",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 2 additions & 0 deletions sdk/storage/storage-file-share/src/utils/utils.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,8 @@ export function padStart(
targetLength: number,
padString: string = " "
): string {
// TS doesn't know this code needs to run downlevel sometimes.
// @ts-expect-error
if (String.prototype.padStart) {
return currentString.padStart(targetLength, padString);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/storage/storage-queue/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
"rollup-plugin-visualizer": "^3.1.1",
"source-map-support": "^0.5.9",
"ts-node": "^8.3.0",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 2 additions & 0 deletions sdk/storage/storage-queue/src/utils/utils.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ export function padStart(
targetLength: number,
padString: string = " "
): string {
// TS doesn't know this code needs to run downlevel sometimes.
// @ts-expect-error
if (String.prototype.padStart) {
return currentString.padStart(targetLength, padString);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/template/template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^3.1.1",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/test-utils/perfstress/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,6 @@
"karma-env-preprocessor": "^0.1.1",
"prettier": "^1.16.4",
"rimraf": "^3.0.0",
"typescript": "~3.8.3"
"typescript": "~3.9.3"
}
}
2 changes: 1 addition & 1 deletion sdk/test-utils/recorder/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"rollup-plugin-sourcemaps": "^0.4.2",
"rollup-plugin-terser": "^5.1.1",
"rollup-plugin-visualizer": "^3.1.1",
"typescript": "~3.8.3",
"typescript": "~3.9.3",
"xhr-mock": "^2.4.1"
}
}
2 changes: 2 additions & 0 deletions sdk/test-utils/recorder/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,8 @@ export async function blobToString(blob: Blob): Promise<string> {
* @returns {string}
*/
function padStart(currentString: string, targetLength: number, padString: string = " "): string {
// TS doesn't know this code needs to run downlevel sometimes.
// @ts-expect-error
if (String.prototype.padStart) {
return currentString.padStart(targetLength, padString);
}
Expand Down
Loading

0 comments on commit ca526b6

Please sign in to comment.