Skip to content

Commit

Permalink
Fix tslint errors after update to latest tslint version
Browse files Browse the repository at this point in the history
  • Loading branch information
bumi committed Jun 3, 2020
1 parent d4bb471 commit 3c62ff7
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/app/modules/account/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export function* handleGetTransactions() {
.map(payment => (payment.path.length ? payment.path[payment.path.length - 1] : ''))
.filter(id => !!id)
.filter((id, idx, ids) => ids.indexOf(id) === idx);
const paymentNodes: Array<Yielded<typeof nodeLib.getNodeInfo>> = yield all(
const paymentNodes: Yielded<typeof nodeLib.getNodeInfo>[] = yield all(
paymentNodeIds.map(id => call(safeGetNodeInfo, nodeLib, id)),
);
const payments = paymentsRes.payments
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/channels/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export function* handleGetChannels() {
},
{} as { [pubkey: string]: boolean },
);
const nodeInfoResponses: Array<Yielded<typeof nodeLib.getNodeInfo>> = yield all(
const nodeInfoResponses: Yielded<typeof nodeLib.getNodeInfo>[] = yield all(
Object.keys(nodePubKeys).map(pk => call(safeGetNodeInfo, nodeLib, pk)),
);
const nodeInfoMap = nodeInfoResponses.reduce(
Expand Down
5 changes: 1 addition & 4 deletions src/app/modules/node/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,7 @@ export function* handleCheckNodes(action: ReturnType<typeof actions.checkNodes>)
}
});
});
const validUrls: Array<string | null> = yield call(
Promise.all.bind(Promise),
requests,
);
const validUrls: (string | null)[] = yield call(Promise.all.bind(Promise), requests);
const validUrl = validUrls.find(url => !!url);
if (!validUrl) {
throw new Error('None of the checked nodes were available');
Expand Down
2 changes: 1 addition & 1 deletion src/app/modules/peers/sagas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export function* handleGetPeers() {
selectNodeLibOrThrow,
);
const { peers }: Yielded<typeof nodeLib.getPeers> = yield call(nodeLib.getPeers);
const nodes: Array<Yielded<typeof nodeLib.getNodeInfo>> = yield all(
const nodes: Yielded<typeof nodeLib.getNodeInfo>[] = yield all(
peers.map(p => call(safeGetNodeInfo, nodeLib, p.pub_key)),
);
const payload = peers.map((peer, i) => ({
Expand Down
6 changes: 3 additions & 3 deletions src/app/prompts/payment.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,18 +280,18 @@ class PaymentPrompt extends React.Component<Props, State> {
}

interface DetailsTableProps {
rows: Array<{
rows: {
label: React.ReactNode;
value: React.ReactNode;
isLarge?: boolean;
}>;
}[];
}

const DetailsTable: React.SFC<DetailsTableProps> = ({ rows }) => (
<table className="DetailsTable">
<tbody>
{rows.map(r => (
<tr className={`DetailsTable-row ${r.isLarge ? 'is-large' : ''}`}>
<tr key={r.label} className={`DetailsTable-row ${r.isLarge ? 'is-large' : ''}`}>
<td className="DetailsTable-row-label">{r.label}</td>
<td className="DetailsTable-row-value">{r.value}</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export interface SyncData<T> {
data: T;
}

export const syncConfigs: Array<SyncConfig<any>> = [
export const syncConfigs: SyncConfig<any>[] = [
{
key: 'crypto',
version: 1,
Expand Down
2 changes: 1 addition & 1 deletion src/app/utils/ts.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// This includes helper functions / types for Typescript
export function typedKeys<T extends object>(e: T): Array<keyof T> {
export function typedKeys<T extends object>(e: T): (keyof T)[] {
return Object.keys(e).map(k => k as keyof T);
}

0 comments on commit 3c62ff7

Please sign in to comment.