Skip to content

Commit

Permalink
Upgrade TypeScript to 4.8 for most packages (#23730)
Browse files Browse the repository at this point in the history
  • Loading branch information
xirzec authored Nov 5, 2022
1 parent ceb5483 commit 526926a
Show file tree
Hide file tree
Showing 130 changed files with 319 additions and 306 deletions.
338 changes: 170 additions & 168 deletions common/config/rush/pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sdk/agrifood/agrifood-farming-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
"typescript": "~4.6.0"
"typescript": "~4.8.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/anomalydetector/ai-anomaly-detector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"nyc": "^15.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1",
"@azure-tools/test-recorder": "^1.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"csv-parse": "^4.4.0"
},
"devDependencies": {
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/appconfiguration/app-configuration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"ts-node": "^10.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"uglify-js": "^3.4.9",
"uuid": "^8.3.0",
"cross-env": "^7.0.2"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/attestation/attestation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"safe-buffer": "^5.2.1",
"source-map-support": "^0.5.9",
"ts-node": "^10.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
},
"//sampleConfiguration": {
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-chat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
},
"//metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"@azure/communication-identity": "^1.0.0"
},
"devDependencies": {
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/communication/communication-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ const assertNotNullOrUndefined = <
if (prop in subObj) {
return subObj[prop];
}
throw new Error(`Property ${prop} is required for identifier of type ${subObjName}.`);
throw new Error(`Property ${String(prop)} is required for identifier of type ${subObjName}.`);
};

const assertMaximumOneNestedModel = (identifier: SerializedCommunicationIdentifier): void => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const assertThrowsMissingProperty = <
): void => {
assert.throws(() => {
deserializeCommunicationIdentifier(serializedIdentifier);
}, `Property ${missingPropertyName} is required for identifier of type ${identifierType}.`);
}, `Property ${String(missingPropertyName)} is required for identifier of type ${identifierType}.`);
};

const assertThrowsTooManyProperties = (
Expand Down
2 changes: 1 addition & 1 deletion sdk/communication/communication-email/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"mocha": "^7.1.1",
"mocha-junit-reporter": "^2.0.0",
"nyc": "^15.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/communication/communication-identity/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,6 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"typescript": "~4.6.0"
"typescript": "~4.8.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/communication/communication-sms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"@types/uuid": "^8.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
},
"//metadata": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"@azure/identity": "^2.0.1"
},
"devDependencies": {
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,6 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"source-map-support": "^0.5.9",
"typescript": "~4.6.0"
"typescript": "~4.8.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/containerregistry/container-registry/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@
"nyc": "^15.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
},
"//sampleConfiguration": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function assertHasProperty<T, U extends keyof T>(
property: U
): asserts obj is T & Required<Pick<T, U>> {
if (!Object.prototype.hasOwnProperty.call(obj, property)) {
throw new RestError(`Expected property ${property} to be defined.`);
throw new RestError(`Expected property ${String(property)} to be defined.`);
}
}

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 @@ -99,6 +99,6 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"ts-node": "^10.0.0",
"typescript": "~4.6.0"
"typescript": "~4.8.0"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-amqp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@
"rollup-plugin-terser": "^5.1.1",
"sinon": "^9.0.2",
"ts-node": "^10.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"ws": "^8.2.0"
}
}
4 changes: 2 additions & 2 deletions sdk/core/core-amqp/review/core-amqp.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ export interface ConnectionConfig {

// @public
export const ConnectionConfig: {
create(connectionString: string, path?: string | undefined): ConnectionConfig;
validate(config: ConnectionConfig, options?: ConnectionConfigOptions | undefined): void;
create(connectionString: string, path?: string): ConnectionConfig;
validate(config: ConnectionConfig, options?: ConnectionConfigOptions): void;
};

// @public
Expand Down
3 changes: 1 addition & 2 deletions sdk/core/core-amqp/src/auth/tokenProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
isNamedKeyCredential,
isSASCredential,
} from "@azure/core-auth";
import { isObjectWithProperties } from "@azure/core-util";
import jssha from "jssha";

/**
Expand Down Expand Up @@ -44,7 +43,7 @@ export function createSasTokenProvider(
): SasTokenProvider {
if (isNamedKeyCredential(data) || isSASCredential(data)) {
return new SasTokenProviderImpl(data);
} else if (isObjectWithProperties(data, ["sharedAccessKeyName", "sharedAccessKey"])) {
} else if ("sharedAccessKeyName" in data && "sharedAccessKey" in data) {
return new SasTokenProviderImpl({ name: data.sharedAccessKeyName, key: data.sharedAccessKey });
} else {
return new SasTokenProviderImpl({ signature: data.sharedAccessSignature });
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
"mocha-junit-reporter": "^2.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-client-rest/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,6 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"typescript": "~4.6.0"
"typescript": "~4.8.0"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"ts-node": "^10.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-http-compat/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,6 @@
"downlevel-dts": "^0.10.0",
"cross-env": "^7.0.2",
"prettier": "^2.5.1",
"typescript": "~4.6.0"
"typescript": "~4.8.0"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-http/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@
"shx": "^0.3.2",
"sinon": "^9.0.2",
"ts-node": "^10.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"uglify-js": "^3.4.9",
"xhr-mock": "^2.4.1"
}
Expand Down
5 changes: 4 additions & 1 deletion sdk/core/core-http/src/nodeFetchHttpClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,10 @@ export class NodeFetchHttpClient implements HttpClient {
body: body,
headers: httpRequest.headers.rawHeaders(),
method: httpRequest.method,
signal: abortController.signal,
// the types for RequestInit are from the browser, which expects AbortSignal to
// have `reason` and `throwIfAborted`, but these don't exist on our polyfill
// for Node.
signal: abortController.signal as any,
redirect: "manual",
...platformSpecificRequestInit,
};
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-lro/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,6 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"ts-node": "^10.0.0",
"typescript": "~4.6.0"
"typescript": "~4.8.0"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-paging/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
"mocha-junit-reporter": "^2.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"typescript": "~4.6.0"
"typescript": "~4.8.0"
},
"//sampleConfiguration": {
"skipFolder": true,
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-paging/samples/v1/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-rest-pipeline/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"source-map-support": "^0.5.9",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
},
"//sampleConfiguration": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"dotenv": "latest"
},
"devDependencies": {
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-tracing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
"mocha-junit-reporter": "^2.0.0",
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1",
"sinon": "^9.0.2",
"@types/sinon": "^9.0.4"
Expand Down
2 changes: 1 addition & 1 deletion sdk/core/core-tracing/samples/v1/typescript/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"devDependencies": {
"@types/node": "^14.0.0",
"typescript": "~4.4.0",
"typescript": "~4.8.0",
"rimraf": "latest"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-util/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
}
}
2 changes: 1 addition & 1 deletion sdk/core/core-xml/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@
"prettier": "^2.5.1",
"rimraf": "^3.0.0",
"sinon": "^9.0.2",
"typescript": "~4.6.0",
"typescript": "~4.8.0",
"util": "^0.12.1"
}
}
Loading

0 comments on commit 526926a

Please sign in to comment.