mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-20 09:20:16 +00:00
Update prettier to latest. Remove tslint (#1641)
* Rev up prettier * Reformat * Remove deprecated tslint * Remove call to tslint and update package-lock.json
This commit is contained in:
@@ -22,7 +22,7 @@ interface ReturnType {
|
||||
|
||||
export function useAADAuth(): ReturnType {
|
||||
const [isLoggedIn, { setTrue: setLoggedIn, setFalse: setLoggedOut }] = useBoolean(
|
||||
Boolean(cachedAccount && cachedTenantId) || false
|
||||
Boolean(cachedAccount && cachedTenantId) || false,
|
||||
);
|
||||
const [account, setAccount] = React.useState<msal.AccountInfo>(cachedAccount);
|
||||
const [tenantId, setTenantId] = React.useState<string>(cachedTenantId);
|
||||
@@ -58,7 +58,7 @@ export function useAADAuth(): ReturnType {
|
||||
setAccount(response.account);
|
||||
localStorage.setItem("cachedTenantId", response.tenantId);
|
||||
},
|
||||
[account, tenantId]
|
||||
[account, tenantId],
|
||||
);
|
||||
|
||||
React.useEffect(() => {
|
||||
|
||||
@@ -34,7 +34,7 @@ export async function fetchDatabaseAccounts(subscriptionId: string, accessToken:
|
||||
export function useDatabaseAccounts(subscriptionId: string, armToken: string): DatabaseAccount[] | undefined {
|
||||
const { data } = useSWR(
|
||||
() => (armToken && subscriptionId ? ["databaseAccounts", subscriptionId, armToken] : undefined),
|
||||
(_, subscriptionId, armToken) => fetchDatabaseAccounts(subscriptionId, armToken)
|
||||
(_, subscriptionId, armToken) => fetchDatabaseAccounts(subscriptionId, armToken),
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ export async function fetchPhoto(accessToken: string): Promise<Blob | void> {
|
||||
};
|
||||
|
||||
return fetch(`${configContext.GRAPH_ENDPOINT}/me/thumbnailPhoto?api-version=1.6`, options).then((response) =>
|
||||
response.blob()
|
||||
response.blob(),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ async function configureFabric(): Promise<Explorer> {
|
||||
tabKind: TabKind.SQLDocuments,
|
||||
} as DataExplorerAction,
|
||||
useDatabases.getState().databases,
|
||||
explorer
|
||||
explorer,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -171,7 +171,7 @@ async function configureFabric(): Promise<Explorer> {
|
||||
break;
|
||||
}
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
sendReadyMessage();
|
||||
@@ -179,7 +179,7 @@ async function configureFabric(): Promise<Explorer> {
|
||||
}
|
||||
|
||||
async function configureHosted(): Promise<Explorer> {
|
||||
const win = (window as unknown) as HostedExplorerChildFrame;
|
||||
const win = window as unknown as HostedExplorerChildFrame;
|
||||
let explorer: Explorer;
|
||||
if (win.hostedConfig.authType === AuthType.EncryptedToken) {
|
||||
explorer = configureWithEncryptedToken(win.hostedConfig);
|
||||
@@ -215,7 +215,7 @@ async function configureHosted(): Promise<Explorer> {
|
||||
}
|
||||
}
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
return explorer;
|
||||
@@ -355,7 +355,7 @@ async function configurePortal(): Promise<Explorer> {
|
||||
if (initMessage) {
|
||||
const message = JSON.parse(initMessage) as DataExplorerInputsFrame;
|
||||
console.warn(
|
||||
"Loaded cached portal iframe message from session storage. Do a full page refresh to get a new message"
|
||||
"Loaded cached portal iframe message from session storage. Do a full page refresh to get a new message",
|
||||
);
|
||||
console.dir(message);
|
||||
updateContextsFromPortalMessage(message);
|
||||
@@ -418,7 +418,7 @@ async function configurePortal(): Promise<Explorer> {
|
||||
explorer.onRefreshResourcesClick();
|
||||
}
|
||||
},
|
||||
false
|
||||
false,
|
||||
);
|
||||
|
||||
sendReadyMessage();
|
||||
|
||||
@@ -25,7 +25,7 @@ export async function fetchSubscriptions(accessToken: string): Promise<Subscript
|
||||
}
|
||||
nextLink = result.nextLink;
|
||||
const validSubscriptions = result.value.filter(
|
||||
(sub) => sub.state === "Enabled" || sub.state === "Warned" || sub.state === "PastDue"
|
||||
(sub) => sub.state === "Enabled" || sub.state === "Warned" || sub.state === "PastDue",
|
||||
);
|
||||
subscriptions = [...subscriptions, ...validSubscriptions];
|
||||
}
|
||||
@@ -35,7 +35,7 @@ export async function fetchSubscriptions(accessToken: string): Promise<Subscript
|
||||
export function useSubscriptions(armToken: string): Subscription[] | undefined {
|
||||
const { data } = useSWR(
|
||||
() => (armToken ? ["subscriptions", armToken] : undefined),
|
||||
(_, armToken) => fetchSubscriptions(armToken)
|
||||
(_, armToken) => fetchSubscriptions(armToken),
|
||||
);
|
||||
return data;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ export const useTerminal: UseStore<TerminalState> = create((set, get) => ({
|
||||
{ type: "stdin", content: [message] },
|
||||
{
|
||||
domain: window.location.origin,
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user