Skip to content

Commit 0479643

Browse files
committed
Fix lint issues
1 parent e48b16e commit 0479643

File tree

4 files changed

+6
-9
lines changed

4 files changed

+6
-9
lines changed

src/api/__tests__/authorize-url.test.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ jest.mock('../../storage');
1111

1212
describe('api', () => {
1313
describe('authorize-url', () => {
14-
const open = (window.open = jest.fn());
15-
1614
const mockedStorage = mocked(storage);
1715

1816
const clientId = 'clientId';

src/api/__tests__/onboard-url.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ describe('api', () => {
1919

2020
test('without calling init', () => {
2121
expect(() => {
22-
const url = onboardUrl(new MtLinkSdk().storedOptions);
22+
onboardUrl(new MtLinkSdk().storedOptions);
2323
}).toThrow('[mt-link-sdk] Make sure to call `init` before calling `onboardUrl/onboard`.');
2424
});
2525

@@ -28,7 +28,7 @@ describe('api', () => {
2828
mtLinkSdk.init(clientId);
2929

3030
expect(() => {
31-
const url = onboardUrl(mtLinkSdk.storedOptions);
31+
onboardUrl(mtLinkSdk.storedOptions);
3232
}).toThrow(
3333
'[mt-link-sdk] Missing option `redirectUri` in `onboardUrl/onboard`, make sure to pass one via `onboardUrl/onboard` options or `init` options.'
3434
);

src/api/open-service-url.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ export default function openServiceUrl(
8585
return stringify(query);
8686
};
8787

88+
const { view: vaultView } = options as VaultServiceTypes;
89+
8890
switch (serviceId) {
8991
case 'vault':
90-
let { view: vaultView } = options as VaultServiceTypes;
91-
9292
if (!vaultView) {
9393
return `${VAULT_DOMAINS[mode]}?${getQueryValue()}`;
9494
}
@@ -123,8 +123,7 @@ export default function openServiceUrl(
123123
}
124124

125125
case 'myaccount':
126-
let { view: myAccountView = '' } = options as MyAccountServiceTypes;
127-
return `${MY_ACCOUNT_DOMAINS[mode]}/${myAccountView}?${getQueryValue()}`;
126+
return `${MY_ACCOUNT_DOMAINS[mode]}/${(options as MyAccountServiceTypes).view || ''}?${getQueryValue()}`;
128127

129128
case 'link-kit':
130129
return `${LINK_KIT_DOMAINS[mode]}?${getQueryValue()}`;

src/helper.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { stringify } from 'qs';
44
import { snakeCase } from 'snake-case';
55
import { createHash } from 'crypto';
66
import { encode } from 'url-safe-base64';
7-
import { v4 as uuid, version } from 'uuid';
7+
import { v4 as uuid } from 'uuid';
88
import storage from './storage';
99

1010
import {

0 commit comments

Comments
 (0)