Skip to content

Commit 10bfd4e

Browse files
authored
Linting: use consistent quotes (#10)
1 parent 74cb29f commit 10bfd4e

File tree

9 files changed

+51
-35
lines changed

9 files changed

+51
-35
lines changed

.eslintrc.js renamed to .eslintrc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
module.exports = {
1+
{
22
"env": {
33
"browser": true,
44
"commonjs": true,
55
"es2021": true,
6-
"node": true
6+
"node": true,
7+
"mocha": true
78
},
89
"extends": [
910
"eslint:recommended",
1011
"plugin:@typescript-eslint/recommended"
1112
],
1213
"ignorePatterns": [
13-
"test/**/*.js"
1414
],
1515
"overrides": [
1616
{
@@ -33,5 +33,12 @@ module.exports = {
3333
"@typescript-eslint"
3434
],
3535
"rules": {
36+
"quotes": [
37+
"error",
38+
"double",
39+
{
40+
"avoidEscape": true
41+
}
42+
],
3643
},
37-
}
44+
}

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,6 @@ jobs:
2323
node-version: ${{ matrix.node-version }}
2424
cache: 'npm'
2525
- run: npm ci
26+
- run: npm run lint
2627
- run: npm run build
2728
- run: npm test

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@
2121
"build-esm": "tsc -p ./",
2222
"clean": "rimraf dist dist-esm",
2323
"dev": "rollup --config --watch",
24-
"lint": "eslint",
24+
"lint": "eslint src/ test/",
25+
"fix-lint": "eslint src/ test/ --fix",
2526
"test": "mocha --timeout 10000"
2627
},
2728
"repository": {

src/Load.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export async function load(
2828
try {
2929
endpoint = new URL(endpoint);
3030
} catch (error) {
31-
if (error.code === 'ERR_INVALID_URL') {
31+
if (error.code === "ERR_INVALID_URL") {
3232
throw new Error("Invalid Endpoint URL.", { cause: error });
3333
} else {
3434
throw error;

test/.eslintrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"rules": {
3+
"@typescript-eslint/no-var-requires": "off"
4+
}
5+
}

test/clientOptions.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ chai.use(chaiAsPromised);
77
const expect = chai.expect;
88
const { load } = require("../dist/index");
99
const { createMockedConnectionString } = require("./utils/testHelper");
10-
const nock = require('nock');
10+
const nock = require("nock");
1111

1212
class HttpRequestCountPolicy {
1313
constructor() {
@@ -21,7 +21,7 @@ class HttpRequestCountPolicy {
2121
resetCount() {
2222
this.count = 0;
2323
}
24-
};
24+
}
2525

2626
describe("custom client options", function () {
2727
const fakeEndpoint = "https://azure.azconfig.io";

test/keyvault.test.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,13 @@ const mockedData = [
2020
];
2121

2222
function mockAppConfigurationClient() {
23+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2324
const kvs = mockedData.map(([key, vaultUri, _value]) => createMockedKeyVaultReference(key, vaultUri));
2425
mockAppConfigurationClientListConfigurationSettings(kvs);
2526
}
2627

2728
function mockNewlyCreatedKeyVaultSecretClients() {
29+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2830
mockSecretClientGetSecret(mockedData.map(([_key, secretUri, value]) => [secretUri, value]));
2931
}
3032
describe("key vault reference", function () {

test/load.test.js

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,49 +15,49 @@ const {
1515
} = require("./utils/testHelper");
1616

1717
const mockedKVs = [{
18-
value: 'red',
19-
key: 'app.settings.fontColor',
18+
value: "red",
19+
key: "app.settings.fontColor",
2020
label: null,
21-
contentType: '',
22-
lastModified: '2023-05-04T04:34:24.000Z',
21+
contentType: "",
22+
lastModified: "2023-05-04T04:34:24.000Z",
2323
tags: {},
24-
etag: '210fjkPIWZMjFTi_qyEEmmsJjtUjj0YQl-Y3s1m6GLw',
24+
etag: "210fjkPIWZMjFTi_qyEEmmsJjtUjj0YQl-Y3s1m6GLw",
2525
isReadOnly: false
2626
}, {
27-
value: '40',
28-
key: 'app.settings.fontSize',
27+
value: "40",
28+
key: "app.settings.fontSize",
2929
label: null,
30-
contentType: '',
31-
lastModified: '2023-05-04T04:32:56.000Z',
30+
contentType: "",
31+
lastModified: "2023-05-04T04:32:56.000Z",
3232
tags: {},
33-
etag: 'GdmsLWq3mFjFodVEXUYRmvFr3l_qRiKAW_KdpFbxZKk',
33+
etag: "GdmsLWq3mFjFodVEXUYRmvFr3l_qRiKAW_KdpFbxZKk",
3434
isReadOnly: false
3535
}, {
36-
value: 'TestValue',
37-
key: 'TestKey',
38-
label: 'Test',
39-
contentType: '',
40-
lastModified: '2023-05-04T04:32:56.000Z',
36+
value: "TestValue",
37+
key: "TestKey",
38+
label: "Test",
39+
contentType: "",
40+
lastModified: "2023-05-04T04:32:56.000Z",
4141
tags: {},
42-
etag: 'GdmsLWq3mFjFodVEXUYRmvFr3l_qRiKAW_KdpFbxZKk',
42+
etag: "GdmsLWq3mFjFodVEXUYRmvFr3l_qRiKAW_KdpFbxZKk",
4343
isReadOnly: false
4444
}, {
4545
value: null,
46-
key: 'KeyForNullValue',
47-
label: '',
48-
contentType: '',
49-
lastModified: '2023-05-04T04:32:56.000Z',
46+
key: "KeyForNullValue",
47+
label: "",
48+
contentType: "",
49+
lastModified: "2023-05-04T04:32:56.000Z",
5050
tags: {},
51-
etag: 'GdmsLWq3mFjFodVEXUYRmvFr3l_qRiKAW_KdpFbxZKk',
51+
etag: "GdmsLWq3mFjFodVEXUYRmvFr3l_qRiKAW_KdpFbxZKk",
5252
isReadOnly: false
5353
}, {
5454
value: "",
55-
key: 'KeyForEmptyValue',
56-
label: '',
57-
contentType: '',
58-
lastModified: '2023-05-04T04:32:56.000Z',
55+
key: "KeyForEmptyValue",
56+
label: "",
57+
contentType: "",
58+
lastModified: "2023-05-04T04:32:56.000Z",
5959
tags: {},
60-
etag: 'GdmsLWq3mFjFodVEXUYRmvFr3l_qRiKAW_KdpFbxZKk',
60+
etag: "GdmsLWq3mFjFodVEXUYRmvFr3l_qRiKAW_KdpFbxZKk",
6161
isReadOnly: false
6262
}];
6363

test/utils/testHelper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const createMockedTokenCredential = (tenantId = TEST_TENANT_ID, clientId = TEST_
5252

5353
const createMockedKeyVaultReference = (key, vaultUri) => ({
5454
// https://${vaultName}.vault.azure.net/secrets/${secretName}
55-
value: `{\"uri\":\"${vaultUri}\"}`,
55+
value: `{"uri":"${vaultUri}"}`,
5656
key,
5757
label: null,
5858
contentType: "application/vnd.microsoft.appconfig.keyvaultref+json;charset=utf-8",

0 commit comments

Comments
 (0)