Skip to content

Commit

Permalink
Bump prettier from 2.2.1 to 2.3.0 (#1421)
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot-preview[bot] authored May 11, 2021
1 parent 3901a8b commit b984079
Show file tree
Hide file tree
Showing 15 changed files with 44 additions and 46 deletions.
6 changes: 4 additions & 2 deletions lib/src/generators/openapi2/openapi2-parameter-util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,10 @@ function integerParameterObject(
};
}

const pathParamArrayTypeToParameterArrayTypeObject = arrayTypeToParameterArrayTypeObject;
const headerArrayTypeToParameterArrayTypeObject = arrayTypeToParameterArrayTypeObject;
const pathParamArrayTypeToParameterArrayTypeObject =
arrayTypeToParameterArrayTypeObject;
const headerArrayTypeToParameterArrayTypeObject =
arrayTypeToParameterArrayTypeObject;
const queryParamArrayTypeToParameterArrayTypeObject = (
type: ArrayType,
typeTable: TypeTable,
Expand Down
5 changes: 2 additions & 3 deletions lib/src/generators/openapi3/openapi3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,9 +374,8 @@ function contractToOa3ServerObject(
? server.oa3ServerVariables.reduce<{
[serverVariable: string]: ServerVariableObject;
}>((acc, serverVariable) => {
acc[
serverVariable.parameterName
] = oa3ServerVariableToServerVariableObject(serverVariable);
acc[serverVariable.parameterName] =
oa3ServerVariableToServerVariableObject(serverVariable);
return acc;
}, {})
: undefined;
Expand Down
6 changes: 4 additions & 2 deletions lib/src/linting/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,10 @@ export const availableRules: LintingRules = {
"has-response": hasResponse,
"no-inline-objects-within-unions": noInlineObjectsWithinUnions,
"no-nullable-arrays": noNullableArrays,
"no-nullable-fields-within-request-bodies": noNullableFieldsWithinRequestBodies,
"no-omittable-fields-within-response-bodies": noOmittableFieldsWithinResponseBodies
"no-nullable-fields-within-request-bodies":
noNullableFieldsWithinRequestBodies,
"no-omittable-fields-within-response-bodies":
noOmittableFieldsWithinResponseBodies
};

interface LintingRules {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ interface Body {
field: InlineObjectUnion;
}

type InlineObjectUnion = /* prettier-ignore */ { name: String } | { title: String };
type InlineObjectUnion = { name: String } | { title: String };
5 changes: 2 additions & 3 deletions lib/src/parsers/config-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,8 @@ export function parseConfig(
>(queryStratLiteral, "array");

if (queryArrayStratProp) {
const queryArrayStratValue = getPropValueAsStringOrThrow(
queryArrayStratProp
).getLiteralText();
const queryArrayStratValue =
getPropValueAsStringOrThrow(queryArrayStratProp).getLiteralText();
if (!isQueryParamArrayStrategy(queryArrayStratValue)) {
throw new Error(
`expected a QueryParamArrayStrategy, got ${queryArrayStratValue}`
Expand Down
5 changes: 2 additions & 3 deletions lib/src/parsers/headers-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ export function parseHeaders(
);
}

const headerPropertySignatures = getParameterPropertySignaturesOrThrow(
parameter
);
const headerPropertySignatures =
getParameterPropertySignaturesOrThrow(parameter);

const headers: Array<Header> = [];
for (const propertySignature of headerPropertySignatures) {
Expand Down
5 changes: 2 additions & 3 deletions lib/src/parsers/oa3server-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,8 @@ function parseOa3Variables(
);
}

const queryParamPropertySignatures = getParameterPropertySignaturesOrThrow(
parameter
);
const queryParamPropertySignatures =
getParameterPropertySignaturesOrThrow(parameter);

const oa3ServerVariableParams: Array<Oa3ServerVariable> = [];

Expand Down
5 changes: 2 additions & 3 deletions lib/src/parsers/path-params-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ export function parsePathParams(
})
);
}
const pathParamPropertySignatures = getParameterPropertySignaturesOrThrow(
parameter
);
const pathParamPropertySignatures =
getParameterPropertySignaturesOrThrow(parameter);

const pathParams = [];
for (const propertySignature of pathParamPropertySignatures) {
Expand Down
5 changes: 2 additions & 3 deletions lib/src/parsers/query-params-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,8 @@ export function parseQueryParams(
})
);
}
const queryParamPropertySignatures = getParameterPropertySignaturesOrThrow(
parameter
);
const queryParamPropertySignatures =
getParameterPropertySignaturesOrThrow(parameter);

const queryParams: Array<QueryParam> = [];
for (const propertySignature of queryParamPropertySignatures) {
Expand Down
18 changes: 9 additions & 9 deletions lib/src/parsers/type-parser.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -537,29 +537,29 @@ describe("type parser", () => {
.getPropertyOrThrow("indexedAccess")
.getTypeNodeOrThrow();

expect(
parseType(type, typeTable, lociTable).unwrapOrThrow()
).toStrictEqual({ kind: "boolean", schemaProps: undefined });
expect(parseType(type, typeTable, lociTable).unwrapOrThrow()).toStrictEqual(
{ kind: "boolean", schemaProps: undefined }
);
});

test("parses nested indexed accessing", () => {
const type = interphace
.getPropertyOrThrow("indexedAccessNested")
.getTypeNodeOrThrow();

expect(
parseType(type, typeTable, lociTable).unwrapOrThrow()
).toStrictEqual({ kind: "boolean", schemaProps: undefined });
expect(parseType(type, typeTable, lociTable).unwrapOrThrow()).toStrictEqual(
{ kind: "boolean", schemaProps: undefined }
);
});

test("parses indexed indexed accessing", () => {
const type = interphace
.getPropertyOrThrow("indexedIndexedAccess")
.getTypeNodeOrThrow();

expect(
parseType(type, typeTable, lociTable).unwrapOrThrow()
).toStrictEqual({ kind: "boolean", schemaProps: undefined });
expect(parseType(type, typeTable, lociTable).unwrapOrThrow()).toStrictEqual(
{ kind: "boolean", schemaProps: undefined }
);
});

test("parses intersection type", () => {
Expand Down
5 changes: 2 additions & 3 deletions lib/src/parsers/type-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,9 +556,8 @@ function parseIndexedAccessType(
typeTable: TypeTable,
lociTable: LociTable
): Result<Type, ParserError> {
const propertyAccessChainResult = resolveIndexAccessPropertyAccessChain(
typeNode
);
const propertyAccessChainResult =
resolveIndexAccessPropertyAccessChain(typeNode);
if (propertyAccessChainResult.isErr()) return propertyAccessChainResult;

const rootReferenceResult = resolveIndexedAccessRootReference(typeNode);
Expand Down
7 changes: 4 additions & 3 deletions lib/src/spec-helpers/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,10 @@ export function createProject(): Project {
});
}

export function createProjectFromExistingSourceFile(
filePath: string
): { project: Project; file: SourceFile } {
export function createProjectFromExistingSourceFile(filePath: string): {
project: Project;
file: SourceFile;
} {
const project = createProject();
const file = project.addSourceFileAtPath(filePath);
project.resolveSourceFileDependencies();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,9 +228,9 @@ export class ContractMismatcher {
case MismatchKind.BODY_TYPE_DISPARITY:
violations.push(
responseBodyTypeDisparityViolation(
`Response body type disparity:\n${
m.data
}\n${m.typeDisparities.map(disp => `- ${disp}`).join("\n")}`,
`Response body type disparity:\n${m.data}\n${m.typeDisparities
.map(disp => `- ${disp}`)
.join("\n")}`,
m.typeDisparities
)
);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"mini-css-extract-plugin": "^1.6.0",
"mobx": "^6.3.0",
"nock": "^13.0.11",
"prettier": "^2.2.1",
"prettier": "^2.3.0",
"react": "^16.14.0",
"react-dom": "^16.14.0",
"redoc": "^2.0.0-rc.53",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6487,10 +6487,10 @@ prelude-ls@~1.1.2:
resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.1.2.tgz#21932a549f5e52ffd9a827f570e04be62a97da54"
integrity sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=

prettier@^2.2.1:
version "2.2.1"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.2.1.tgz#795a1a78dd52f073da0cd42b21f9c91381923ff5"
integrity sha512-PqyhM2yCjg/oKkFPtTGUojv7gnZAoG80ttl45O6x2Ug/rMJw4wcc9k6aaf2hibP7BGVCCM33gZoGjyvt9mm16Q==
prettier@^2.3.0:
version "2.3.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.3.0.tgz#b6a5bf1284026ae640f17f7ff5658a7567fc0d18"
integrity sha512-kXtO4s0Lz/DW/IJ9QdWhAf7/NmPWQXkFr/r/WkR3vyI+0v8amTDxiaQSLzs8NBlytfLWX/7uQUMIW677yLKl4w==

pretty-error@^2.1.1:
version "2.1.2"
Expand Down

0 comments on commit b984079

Please sign in to comment.