Skip to content

Commit

Permalink
[engsys] fix check-format failures (Azure#24439)
Browse files Browse the repository at this point in the history
* [engsys] fix check-format failures

- keyvault-command doesn't have samples-dev directory
- result of of `rush format`.  formatting changes that potentially caused by prettier upgrade

* form-recognizer api.md formatting change
  • Loading branch information
jeremymeng authored Jan 11, 2023
1 parent 51a8ccd commit 696ec98
Show file tree
Hide file tree
Showing 14 changed files with 18 additions and 22 deletions.
2 changes: 1 addition & 1 deletion common/tools/dev-tool/src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export const baseCommands = {
package: () => import("./package"),
samples: () => import("./samples"),
"test-proxy": () => import("./test-proxy"),
run: () => import("./run")
run: () => import("./run"),
} as const;

/**
Expand Down
2 changes: 1 addition & 1 deletion common/tools/dev-tool/src/commands/run/vendored.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export default async (...args: string[]): Promise<boolean> => {
commands.map((commandName) => {
const moduleSham: CommandModule<CommandOptions> = {
commandInfo: makeCommandInfo(commandName, `run vendored "${commandName}" from dev-tool`),
default: makeCommandExecutor(commandName)
default: makeCommandExecutor(commandName),
};

return [commandName, () => Promise.resolve(moduleSham)];
Expand Down
2 changes: 1 addition & 1 deletion common/tools/dev-tool/src/util/printer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import path from "path";
const printModes = ["info", "warn", "error", "success", "debug"] as const;

export type Fn<T = void> = (...values: any[]) => T;
export type ModeMap<T> = { [k in typeof printModes[number]]: T };
export type ModeMap<T> = { [k in (typeof printModes)[number]]: T };

// Compute the base directory of the dev-tool command package
// We must do this specially for the printer module because using
Expand Down
2 changes: 1 addition & 1 deletion common/tools/dev-tool/src/util/samples/syntax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type UnionToIntersection<Union> =
type SyntaxTest = (node: ts.Node) => boolean;

type SyntaxName = keyof UnionToIntersection<
typeof SYNTAX_VIABILITY_TESTS[keyof typeof SYNTAX_VIABILITY_TESTS]
(typeof SYNTAX_VIABILITY_TESTS)[keyof typeof SYNTAX_VIABILITY_TESTS]
>;

/**
Expand Down
2 changes: 1 addition & 1 deletion sdk/eventhub/event-hubs/test/public/hubruntime.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ testWithServiceTypes((serviceVersion) => {
"EventHubConsumerClient",
"EventHubProducerClient",
] as const;
const clientMap = new Map<typeof clientTypes[number], ClientCommonMethods>();
const clientMap = new Map<(typeof clientTypes)[number], ClientCommonMethods>();

const service = {
connectionString: env[EnvVarKeys.EVENTHUB_CONNECTION_STRING],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export interface DocumentModelAdministrationClientOptions extends FormRecognizer
}

// @public
export type DocumentModelBuildMode = typeof DocumentModelBuildMode[keyof typeof DocumentModelBuildMode];
export type DocumentModelBuildMode = (typeof DocumentModelBuildMode)[keyof typeof DocumentModelBuildMode];

// @public
export const DocumentModelBuildMode: {
Expand Down Expand Up @@ -493,7 +493,7 @@ export interface ErrorModel {
}

// @public
export type FormRecognizerApiVersion = typeof FormRecognizerApiVersion[keyof typeof FormRecognizerApiVersion];
export type FormRecognizerApiVersion = (typeof FormRecognizerApiVersion)[keyof typeof FormRecognizerApiVersion];

// @public
export const FormRecognizerApiVersion: {
Expand Down Expand Up @@ -616,7 +616,7 @@ export interface ResourceDetails {
export type SelectionMarkState = string;

// @public
export type StringIndexType = typeof StringIndexType[keyof typeof StringIndexType];
export type StringIndexType = (typeof StringIndexType)[keyof typeof StringIndexType];

// @public
export const StringIndexType: {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { PollerOptions } from "./PollerOptions";
* Please see the following link for more information: https://aka.ms/azsdk/formrecognizer/buildmode
*/
export type DocumentModelBuildMode =
typeof DocumentModelBuildMode[keyof typeof DocumentModelBuildMode];
(typeof DocumentModelBuildMode)[keyof typeof DocumentModelBuildMode];

/**
* Supported values of `DocumentModelBuildMode`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { CommonClientOptions } from "@azure/core-client";
* Valid values of the Form Recognizer service REST API version.
*/
export type FormRecognizerApiVersion =
typeof FormRecognizerApiVersion[keyof typeof FormRecognizerApiVersion];
(typeof FormRecognizerApiVersion)[keyof typeof FormRecognizerApiVersion];

/**
* Supported and common values of FormRecognizerApiVersion.
Expand All @@ -29,7 +29,7 @@ export const FormRecognizerApiVersion = {
/**
* Valid string index types supported by the Form Recognizer service and SDK clients.
*/
export type StringIndexType = typeof StringIndexType[keyof typeof StringIndexType];
export type StringIndexType = (typeof StringIndexType)[keyof typeof StringIndexType];

/**
* Supported values of StringIndexType.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const serviceVersions = ["7.0", "7.1", "7.2", "7.3", "7.4-preview.1"] as
*/
export function getServiceVersion(): NonNullable<CertificateClientOptions["serviceVersion"]> {
return (
(env.SERVICE_VERSION as typeof serviceVersions[number] | undefined) ||
(env.SERVICE_VERSION as (typeof serviceVersions)[number] | undefined) ||
serviceVersions[serviceVersions.length - 1]
);
}
Expand Down
2 changes: 1 addition & 1 deletion sdk/keyvault/keyvault-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"clean": "rimraf dist dist-* temp types *.tgz *.log",
"execute:samples": "dev-tool samples run samples-dev",
"extract-api": "tsc -p . && api-extractor run --local",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"*.{js,json}\"",
"integration-test:browser": "echo skipped",
"integration-test:node": "echo skipped",
"integration-test": "npm run integration-test:node && npm run integration-test:browser",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ describe("Receiver unit tests", () => {

async function subscribeAndWaitForInitialize(
receiver: ServiceBusReceiverImpl
): Promise<ReturnType<typeof receiver["subscribe"]>> {
): Promise<ReturnType<(typeof receiver)["subscribe"]>> {
const sub = await new Promise<{
close(): Promise<void>;
}>((resolve, reject) => {
Expand Down
10 changes: 4 additions & 6 deletions sdk/storage/storage-internal-avro/src/AvroParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,10 +355,7 @@ class AvroPrimitiveType extends AvroType {
this._primitive = primitive;
}

public read(
stream: AvroReadable,
options: AvroParserReadOptions = {}
): Promise<Object | null> {
public read(stream: AvroReadable, options: AvroParserReadOptions = {}): Promise<Object | null> {
switch (this._primitive) {
case AvroPrimitive.NULL:
return AvroParser.readNull();
Expand Down Expand Up @@ -407,7 +404,8 @@ class AvroUnionType extends AvroType {
public async read(
stream: AvroReadable,
options: AvroParserReadOptions = {}
): Promise<Object | null> { // eslint-disable-line @typescript-eslint/ban-types
): Promise<Object | null> {
// eslint-disable-line @typescript-eslint/ban-types
const typeIndex = await AvroParser.readInt(stream, options);
return this._types[typeIndex].read(stream, options);
}
Expand All @@ -425,7 +423,7 @@ class AvroMapType extends AvroType {
const readItemMethod = (
s: AvroReadable,
opts?: AvroParserReadOptions
): Promise<Object | null> => {
): Promise<Object | null> => {
return this._itemType.read(s, opts);
};
return AvroParser.readMap(stream, readItemMethod, options);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class AvroReadableFromBlob extends AvroReadable {

const fileReader = new FileReader();
return new Promise<Uint8Array>((resolve, reject) => {

function cleanUp(): void {
if (options.abortSignal) {
options.abortSignal!.removeEventListener("abort", abortHandler);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ class TestCase {
}

describe("AvroReader", () => {

it("test with local avro files", async () => {
const testCases: TestCase[] = [
new TestCase("test_null_0.avro", (o) => assert.strictEqual(null, o)), // null
Expand Down

0 comments on commit 696ec98

Please sign in to comment.