Skip to content
This repository was archived by the owner on Apr 13, 2020. It is now read-only.

Commit 078cbc6

Browse files
authored
disable eslint camel case check (#417)
1 parent 890b3aa commit 078cbc6

File tree

9 files changed

+160
-151
lines changed

9 files changed

+160
-151
lines changed

src/commands/deployment/dashboard.test.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/camelcase */
12
jest.mock("open");
23
import open from "open";
34
jest.mock("../../config");
@@ -30,18 +31,18 @@ afterAll(() => {
3031

3132
const mockConfig = (): void => {
3233
(Config as jest.Mock).mockReturnValueOnce({
33-
"azure_devops": {
34-
"access_token": uuid(),
34+
azure_devops: {
35+
access_token: uuid(),
3536
org: uuid(),
3637
project: uuid()
3738
},
3839
introspection: {
3940
azure: {
40-
"account_name": uuid(),
41+
account_name: uuid(),
4142
key: uuid(),
42-
"partition_key": uuid(),
43-
"source_repo_access_token": "test_token",
44-
"table_name": uuid()
43+
partition_key: uuid(),
44+
source_repo_access_token: "test_token",
45+
table_name: uuid()
4546
}
4647
}
4748
});
@@ -208,8 +209,8 @@ describe("Fallback to azure devops access token", () => {
208209
describe("Extract manifest repository information", () => {
209210
test("Manifest repository information is successfully extracted", () => {
210211
(Config as jest.Mock).mockReturnValue({
211-
"azure_devops": {
212-
"manifest_repository":
212+
azure_devops: {
213+
manifest_repository:
213214
"https://dev.azure.com/bhnook/fabrikam/_git/materialized"
214215
}
215216
});

src/commands/deployment/validate.test.ts

+13-12
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/camelcase */
12
// imports
23
import uuid from "uuid/v4";
34
import * as deploymenttable from "../../lib/azure/deploymenttable";
@@ -134,16 +135,16 @@ afterAll(() => {
134135
describe("Validate deployment configuration", () => {
135136
test("valid deployment configuration", async () => {
136137
const config: ConfigYaml = {
137-
"azure_devops": {
138+
azure_devops: {
138139
org: uuid(),
139140
project: uuid()
140141
},
141142
introspection: {
142143
azure: {
143-
"account_name": uuid(),
144+
account_name: uuid(),
144145
key: Promise.resolve(uuid()),
145-
"partition_key": uuid(),
146-
"table_name": uuid()
146+
partition_key: uuid(),
147+
table_name: uuid()
147148
}
148149
}
149150
};
@@ -210,7 +211,7 @@ describe("test runSelfTest function", () => {
210211
introspection: {
211212
azure: {
212213
key: Promise.resolve(uuid()),
213-
"table_name": undefined
214+
table_name: undefined
214215
}
215216
}
216217
};
@@ -229,7 +230,7 @@ describe("test runSelfTest function", () => {
229230
introspection: {
230231
azure: {
231232
key: Promise.resolve(uuid()),
232-
"table_name": undefined
233+
table_name: undefined
233234
}
234235
}
235236
};
@@ -244,7 +245,7 @@ describe("test runSelfTest function", () => {
244245
introspection: {
245246
azure: {
246247
key: Promise.resolve(uuid()),
247-
"table_name": undefined
248+
table_name: undefined
248249
}
249250
}
250251
};
@@ -277,7 +278,7 @@ describe("Validate missing deployment.storage configuration", () => {
277278
const config: ConfigYaml = {
278279
introspection: {
279280
azure: {
280-
"account_name": undefined,
281+
account_name: undefined,
281282
key: Promise.resolve(uuid())
282283
}
283284
}
@@ -292,7 +293,7 @@ describe("Validate missing deployment.storage configuration", () => {
292293
introspection: {
293294
azure: {
294295
key: Promise.resolve(uuid()),
295-
"table_name": undefined
296+
table_name: undefined
296297
}
297298
}
298299
};
@@ -306,7 +307,7 @@ describe("Validate missing deployment.storage configuration", () => {
306307
introspection: {
307308
azure: {
308309
key: Promise.resolve(uuid()),
309-
"partition_key": undefined
310+
partition_key: undefined
310311
}
311312
}
312313
};
@@ -343,7 +344,7 @@ describe("Validate missing deployment.pipeline configuration", () => {
343344
describe("Validate missing deployment.pipeline configuration", () => {
344345
test("missing deployment.pipeline.org configuration", async () => {
345346
const config: ConfigYaml = {
346-
"azure_devops": {
347+
azure_devops: {
347348
org: undefined
348349
},
349350
introspection: {
@@ -359,7 +360,7 @@ describe("Validate missing deployment.pipeline configuration", () => {
359360
describe("Validate missing deployment.pipeline configuration", () => {
360361
test("missing deployment.pipeline.project configuration", async () => {
361362
const config: ConfigYaml = {
362-
"azure_devops": {
363+
azure_devops: {
363364
org: "org",
364365
project: undefined
365366
},

src/commands/init.test.ts

+15-14
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/camelcase */
12
import axios from "axios";
23
import fs from "fs";
34
import inquirer from "inquirer";
@@ -106,8 +107,8 @@ describe("Test execute function", () => {
106107
describe("test getConfig function", () => {
107108
it("with configuration file", () => {
108109
const mockedValues = {
109-
"azure_devops": {
110-
"access_token": "access_token",
110+
azure_devops: {
111+
access_token: "access_token",
111112
org: "org",
112113
project: "project"
113114
}
@@ -124,8 +125,8 @@ describe("test getConfig function", () => {
124125
});
125126
const cfg = getConfig();
126127
expect(cfg).toStrictEqual({
127-
"azure_devops": {
128-
"access_token": "",
128+
azure_devops: {
129+
access_token: "",
129130
org: "",
130131
project: ""
131132
}
@@ -141,7 +142,7 @@ describe("test validatePersonalAccessToken function", () => {
141142
})
142143
);
143144
const result = await validatePersonalAccessToken({
144-
"access_token": "token",
145+
access_token: "token",
145146
org: "org",
146147
project: "project"
147148
});
@@ -153,7 +154,7 @@ describe("test validatePersonalAccessToken function", () => {
153154
.spyOn(axios, "get")
154155
.mockReturnValueOnce(Promise.reject(new Error("fake")));
155156
const result = await validatePersonalAccessToken({
156-
"access_token": "token",
157+
access_token: "token",
157158
org: "org",
158159
project: "project"
159160
});
@@ -166,16 +167,16 @@ const testHandleInteractiveModeFunc = async (
166167
verified: boolean
167168
): Promise<void> => {
168169
jest.spyOn(init, "getConfig").mockReturnValueOnce({
169-
"azure_devops": {
170-
"access_token": "",
170+
azure_devops: {
171+
access_token: "",
171172
org: "",
172173
project: ""
173174
}
174175
});
175176
jest.spyOn(init, "prompt").mockResolvedValueOnce({
176-
"azdo_org_name": "org_name",
177-
"azdo_pat": "pat",
178-
"azdo_project_name": "project"
177+
azdo_org_name: "org_name",
178+
azdo_pat: "pat",
179+
azdo_project_name: "project"
179180
});
180181
jest
181182
.spyOn(init, "validatePersonalAccessToken")
@@ -206,9 +207,9 @@ describe("test handleInteractiveMode function", () => {
206207
describe("test prompt function", () => {
207208
it("positive test", async done => {
208209
const answers = {
209-
"azdo_org_name": "org",
210-
"azdo_pat": "pat",
211-
"azdo_project_name": "project"
210+
azdo_org_name: "org",
211+
azdo_pat: "pat",
212+
azdo_project_name: "project"
212213
};
213214
jest.spyOn(inquirer, "prompt").mockResolvedValueOnce(answers);
214215
const ans = await prompt({});

src/commands/init.ts

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/camelcase */
12
import axios from "axios";
23
import commander from "commander";
34
import fs from "fs";
@@ -76,9 +77,9 @@ export const prompt = async (curConfig: ConfigYaml): Promise<Answer> => {
7677
];
7778
const answers = await inquirer.prompt(questions);
7879
return {
79-
"azdo_org_name": answers.azdo_org_name as string,
80-
"azdo_pat": answers.azdo_pat as string,
81-
"azdo_project_name": answers.azdo_project_name as string
80+
azdo_org_name: answers.azdo_org_name as string,
81+
azdo_pat: answers.azdo_pat as string,
82+
azdo_project_name: answers.azdo_project_name as string
8283
};
8384
};
8485

@@ -93,8 +94,8 @@ export const getConfig = (): ConfigYaml => {
9394
} catch (_) {
9495
// current config is not found.
9596
return {
96-
"azure_devops": {
97-
"access_token": "",
97+
azure_devops: {
98+
access_token: "",
9899
org: "",
99100
project: ""
100101
}

src/commands/setup.test.ts

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/camelcase */
12
import path from "path";
23
import { readYaml } from "../config";
34
import * as config from "../config";
@@ -37,7 +38,7 @@ describe("test createSPKConfig function", () => {
3738
createSPKConfig(mockRequestContext);
3839
const data = readYaml<ConfigYaml>(tmpFile);
3940
expect(data.azure_devops).toStrictEqual({
40-
"access_token": "pat",
41+
access_token: "pat",
4142
org: "orgname",
4243
project: "project"
4344
});
@@ -56,16 +57,16 @@ describe("test createSPKConfig function", () => {
5657

5758
const data = readYaml<ConfigYaml>(tmpFile);
5859
expect(data.azure_devops).toStrictEqual({
59-
"access_token": "pat",
60+
access_token: "pat",
6061
org: "orgname",
6162
project: "project"
6263
});
6364
expect(data.introspection).toStrictEqual({
6465
azure: {
65-
"service_principal_id": rc.servicePrincipalId,
66-
"service_principal_secret": rc.servicePrincipalPassword,
67-
"subscription_id": rc.subscriptionId,
68-
"tenant_id": rc.servicePrincipalTenantId
66+
service_principal_id: rc.servicePrincipalId,
67+
service_principal_secret: rc.servicePrincipalPassword,
68+
subscription_id: rc.subscriptionId,
69+
tenant_id: rc.servicePrincipalTenantId
6970
}
7071
});
7172
});

src/commands/setup.ts

+9-8
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/camelcase */
12
import commander from "commander";
23
import fs from "fs";
34
import yaml from "js-yaml";
@@ -45,23 +46,23 @@ interface APIError {
4546
export const createSPKConfig = (rc: RequestContext): void => {
4647
const data = rc.toCreateAppRepo
4748
? {
48-
"azure_devops": {
49-
"access_token": rc.accessToken,
49+
azure_devops: {
50+
access_token: rc.accessToken,
5051
org: rc.orgName,
5152
project: rc.projectName
5253
},
5354
introspection: {
5455
azure: {
55-
"service_principal_id": rc.servicePrincipalId,
56-
"service_principal_secret": rc.servicePrincipalPassword,
57-
"subscription_id": rc.subscriptionId,
58-
"tenant_id": rc.servicePrincipalTenantId
56+
service_principal_id: rc.servicePrincipalId,
57+
service_principal_secret: rc.servicePrincipalPassword,
58+
subscription_id: rc.subscriptionId,
59+
tenant_id: rc.servicePrincipalTenantId
5960
}
6061
}
6162
}
6263
: {
63-
"azure_devops": {
64-
"access_token": rc.accessToken,
64+
azure_devops: {
65+
access_token: rc.accessToken,
6566
org: rc.orgName,
6667
project: rc.projectName
6768
}

0 commit comments

Comments
 (0)