Skip to content

Commit d7c83f4

Browse files
committed
Apply new linting rules.
1 parent c1eb62b commit d7c83f4

File tree

7 files changed

+66
-38
lines changed

7 files changed

+66
-38
lines changed

src/diff/amfGraphDifferencer.test.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -313,9 +313,8 @@ describe("Changes to the reference node ID with in a node", () => {
313313
const oldReferenceValue = {
314314
[AmfGraphTypes.KEY_NODE_ID]: "#/declarations/securitySchemes/test",
315315
};
316-
baseGraph[AmfGraphTypes.KEY_GRAPH][1][
317-
"security:scheme"
318-
] = oldReferenceValue;
316+
baseGraph[AmfGraphTypes.KEY_GRAPH][1]["security:scheme"] =
317+
oldReferenceValue;
319318

320319
const newGraph = buildValidGraph();
321320
const newReferenceValue = {

src/diff/diffDirectories.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,8 @@ export async function diffApiModels(
2929
const leftRaml = path.join(leftApi.path, leftApi.main);
3030
const rightRaml = path.join(rightApi.path, rightApi.main);
3131
const differencer = new ApiDifferencer(leftRaml, rightRaml);
32-
changes.changed[
33-
leftApi.main
34-
] = await differencer.findAndCategorizeChanges();
32+
changes.changed[leftApi.main] =
33+
await differencer.findAndCategorizeChanges();
3534
} catch (error) {
3635
ramlToolLogger.error(
3736
`Diff operation for '${leftApi.name}' failed:`,

src/download/exchangeDownloader.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2020, salesforce.com, inc.
2+
* Copyright (c) 2021, salesforce.com, inc.
33
* All rights reserved.
44
* SPDX-License-Identifier: BSD-3-Clause
55
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/BSD-3-Clause
@@ -41,7 +41,9 @@ const ANYPOINT_API_URI_V2 = `${ANYPOINT_BASE_URI}/api/v2`;
4141
*/
4242
export async function runFetch(
4343
url: string,
44+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4445
options: { [key: string]: any } = {}
46+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4547
): Promise<any> {
4648
options.retry = _.merge({}, retryOptions, options.retry);
4749
options = _.merge(options, {

src/generate/handlebarsAmfHelpers.test.ts

Lines changed: 40 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,15 @@ describe("HandlebarsAmfHelpers", () => {
5656
});
5757

5858
it("returns false on valid optional properties", () => {
59-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
59+
const property: model.domain.PropertyShape =
60+
new model.domain.PropertyShape();
6061
property.withMinCount(0);
6162
expect(isRequiredProperty(property)).to.be.false;
6263
});
6364

6465
it("returns true on valid required class", () => {
65-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
66+
const property: model.domain.PropertyShape =
67+
new model.domain.PropertyShape();
6668
property.withMinCount(1);
6769
expect(isRequiredProperty(property)).to.be.true;
6870
});
@@ -78,13 +80,15 @@ describe("HandlebarsAmfHelpers", () => {
7880
});
7981

8082
it("returns false on valid required property", () => {
81-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
83+
const property: model.domain.PropertyShape =
84+
new model.domain.PropertyShape();
8285
property.withMinCount(1);
8386
expect(isOptionalProperty(property)).to.be.false;
8487
});
8588

8689
it("returns true on valid optional property", () => {
87-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
90+
const property: model.domain.PropertyShape =
91+
new model.domain.PropertyShape();
8892
property.withMinCount(0);
8993
expect(isOptionalProperty(property)).to.be.true;
9094
});
@@ -100,7 +104,8 @@ describe("HandlebarsAmfHelpers", () => {
100104
});
101105

102106
it("returns empty array on model containing only additional property", () => {
103-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
107+
const property: model.domain.PropertyShape =
108+
new model.domain.PropertyShape();
104109
property.withName("//");
105110
const typeDto = new model.domain.NodeShape();
106111
typeDto.withProperties([property]);
@@ -109,7 +114,8 @@ describe("HandlebarsAmfHelpers", () => {
109114
});
110115

111116
it("returns empty array on model containing only one additional property with regex", () => {
112-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
117+
const property: model.domain.PropertyShape =
118+
new model.domain.PropertyShape();
113119
property.withName("/.*/");
114120
const typeDto = new model.domain.NodeShape();
115121
typeDto.withProperties([property]);
@@ -118,7 +124,8 @@ describe("HandlebarsAmfHelpers", () => {
118124
});
119125

120126
it("returns empty array on model containing only one additional property with specific regex", () => {
121-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
127+
const property: model.domain.PropertyShape =
128+
new model.domain.PropertyShape();
122129
property.withName("/^c_.+$/?");
123130
property.withMinCount(1);
124131
const typeDto = new model.domain.NodeShape();
@@ -128,7 +135,8 @@ describe("HandlebarsAmfHelpers", () => {
128135
});
129136

130137
it("returns empty array on model containing only one additional property with prefix regex", () => {
131-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
138+
const property: model.domain.PropertyShape =
139+
new model.domain.PropertyShape();
132140
property.withName("^c_.+$");
133141
property.withMinCount(1);
134142
const typeDto = new model.domain.NodeShape();
@@ -142,10 +150,14 @@ describe("HandlebarsAmfHelpers", () => {
142150
});
143151

144152
it("returns an array of required and optional parameters on model with required, optional and additional parameters", () => {
145-
const property1: model.domain.PropertyShape = new model.domain.PropertyShape();
146-
const property2: model.domain.PropertyShape = new model.domain.PropertyShape();
147-
const property3: model.domain.PropertyShape = new model.domain.PropertyShape();
148-
const property4: model.domain.PropertyShape = new model.domain.PropertyShape();
153+
const property1: model.domain.PropertyShape =
154+
new model.domain.PropertyShape();
155+
const property2: model.domain.PropertyShape =
156+
new model.domain.PropertyShape();
157+
const property3: model.domain.PropertyShape =
158+
new model.domain.PropertyShape();
159+
const property4: model.domain.PropertyShape =
160+
new model.domain.PropertyShape();
149161
property1.withName("required");
150162
property1.withMinCount(1);
151163
property2.withName("optional");
@@ -159,8 +171,10 @@ describe("HandlebarsAmfHelpers", () => {
159171
});
160172

161173
it("returns an array with inherited parameters", () => {
162-
const inheritedProp: model.domain.PropertyShape = new model.domain.PropertyShape();
163-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
174+
const inheritedProp: model.domain.PropertyShape =
175+
new model.domain.PropertyShape();
176+
const property: model.domain.PropertyShape =
177+
new model.domain.PropertyShape();
164178
inheritedProp.withName("p1");
165179
inheritedProp.withMinCount(1);
166180
property.withName("p2");
@@ -175,8 +189,10 @@ describe("HandlebarsAmfHelpers", () => {
175189
});
176190

177191
it("returns an array with linked parameters", () => {
178-
const property1: model.domain.PropertyShape = new model.domain.PropertyShape();
179-
const property2: model.domain.PropertyShape = new model.domain.PropertyShape();
192+
const property1: model.domain.PropertyShape =
193+
new model.domain.PropertyShape();
194+
const property2: model.domain.PropertyShape =
195+
new model.domain.PropertyShape();
180196
property1.withName("p1");
181197
property1.withMinCount(1);
182198
property2.withName("p2");
@@ -190,10 +206,14 @@ describe("HandlebarsAmfHelpers", () => {
190206
});
191207

192208
it("returns an array excluding duplicate properties", () => {
193-
const property1: model.domain.PropertyShape = new model.domain.PropertyShape();
194-
const property2: model.domain.PropertyShape = new model.domain.PropertyShape();
195-
const property3: model.domain.PropertyShape = new model.domain.PropertyShape();
196-
const property4: model.domain.PropertyShape = new model.domain.PropertyShape();
209+
const property1: model.domain.PropertyShape =
210+
new model.domain.PropertyShape();
211+
const property2: model.domain.PropertyShape =
212+
new model.domain.PropertyShape();
213+
const property3: model.domain.PropertyShape =
214+
new model.domain.PropertyShape();
215+
const property4: model.domain.PropertyShape =
216+
new model.domain.PropertyShape();
197217
property1.withName("p1");
198218
property1.withMinCount(1);
199219
property2.withName("duplicate");

src/generate/handlebarsAmfHelpersGetType.test.ts

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ describe("HandlebarsAmfHelpers get type helper functions", () => {
4242
});
4343

4444
it("returns 'boolean' on boolean data type", () => {
45-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
45+
const property: model.domain.PropertyShape =
46+
new model.domain.PropertyShape();
4647
property.withRange(
4748
getScalarType("http://www.w3.org/2001/XMLSchema#boolean")
4849
);
@@ -51,7 +52,8 @@ describe("HandlebarsAmfHelpers get type helper functions", () => {
5152
});
5253

5354
it("returns 'number' on float data type", () => {
54-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
55+
const property: model.domain.PropertyShape =
56+
new model.domain.PropertyShape();
5557
property.withRange(
5658
getScalarType("http://www.w3.org/2001/XMLSchema#float")
5759
);
@@ -60,7 +62,8 @@ describe("HandlebarsAmfHelpers get type helper functions", () => {
6062
});
6163

6264
it("returns 'boolean' on boolean linked data type", () => {
63-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
65+
const property: model.domain.PropertyShape =
66+
new model.domain.PropertyShape();
6467
property.withRange(
6568
getLinkedScalarType("http://www.w3.org/2001/XMLSchema#boolean")
6669
);
@@ -69,7 +72,8 @@ describe("HandlebarsAmfHelpers get type helper functions", () => {
6972
});
7073

7174
it("returns 'any' on undefined data type", () => {
72-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
75+
const property: model.domain.PropertyShape =
76+
new model.domain.PropertyShape();
7377
property.withRange(getScalarType(undefined));
7478

7579
expect(getTypeFromProperty(property)).to.equal("any");
@@ -107,7 +111,8 @@ describe("HandlebarsAmfHelpers get type helper functions", () => {
107111
const range: model.domain.ArrayShape = new model.domain.ArrayShape();
108112
range.withItems(getScalarType("http://www.w3.org/2001/XMLSchema#string"));
109113

110-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
114+
const property: model.domain.PropertyShape =
115+
new model.domain.PropertyShape();
111116
property.withRange(range);
112117

113118
expect(getTypeFromProperty(property)).to.equal("Array<string>");
@@ -117,7 +122,8 @@ describe("HandlebarsAmfHelpers get type helper functions", () => {
117122
const range: model.domain.ArrayShape = new model.domain.ArrayShape();
118123
range.withItems(getLinkedType("defined_type"));
119124

120-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
125+
const property: model.domain.PropertyShape =
126+
new model.domain.PropertyShape();
121127
property.withRange(range);
122128

123129
expect(getTypeFromProperty(property)).to.equal("Array<defined_type>");
@@ -129,7 +135,8 @@ describe("HandlebarsAmfHelpers get type helper functions", () => {
129135
getLinkedScalarType("http://www.w3.org/2001/XMLSchema#string")
130136
);
131137

132-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
138+
const property: model.domain.PropertyShape =
139+
new model.domain.PropertyShape();
133140
property.withRange(range);
134141

135142
expect(getTypeFromProperty(property)).to.equal("Array<string>");
@@ -141,7 +148,8 @@ describe("HandlebarsAmfHelpers get type helper functions", () => {
141148

142149
const arrType = new model.domain.ArrayShape();
143150
arrType.withInherits([inheritedType]);
144-
const property: model.domain.PropertyShape = new model.domain.PropertyShape();
151+
const property: model.domain.PropertyShape =
152+
new model.domain.PropertyShape();
145153
property.withRange(arrType);
146154

147155
expect(getTypeFromProperty(property)).to.equal("Array<defined_type>");

testResources/download/resources/restApiResponseObjects.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { download } from "../../../src/";
88

99
export const searchAssetApiResultObject: download.RestApi[] = [
1010
{
11-
id:
12-
"893f605e-10e2-423a-bdb4-f952f56eb6d8/shop-products-categories-api-v1/0.0.1",
11+
id: "893f605e-10e2-423a-bdb4-f952f56eb6d8/shop-products-categories-api-v1/0.0.1",
1312
name: "Shopper Products",
1413
groupId: "893f605e-10e2-423a-bdb4-f952f56eb6d8",
1514
assetId: "shop-products-categories-api-v1",

testResources/generate/handlebarsAmfHelpersTestUtils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ export const getInheritedType = (typeName: string): model.domain.AnyShape => {
4444
};
4545

4646
export const getObjectType = (): model.domain.NodeShape => {
47-
const objProperty: model.domain.PropertyShape = new model.domain.PropertyShape();
47+
const objProperty: model.domain.PropertyShape =
48+
new model.domain.PropertyShape();
4849
objProperty.withName("test");
4950

5051
const objType = new model.domain.NodeShape();

0 commit comments

Comments
 (0)