Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
"noBannedTypes": "off",
"noForEach": "off"
},
"correctness": {
"noUnusedFunctionParameters": "error",
"noUnusedVariables": "error"
},
"performance": {
"noAccumulatingSpread": "off"
},
Expand Down
1 change: 0 additions & 1 deletion src/screens/Activity/ActivityDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,6 @@ const OnchainActivityDetail = ({
const dispatch = useAppDispatch();
const contacts = useAppSelector(contactsSelector);
const tags = useAppSelector((state) => tagSelector(state, id));
const selectedNetwork = useAppSelector(selectedNetworkSelector);
const activityItems = useAppSelector(activityItemsSelector);
const boostedTransactions = useAppSelector(boostedTransactionsSelector);
const transfer = useAppSelector((state) => {
Expand Down
4 changes: 2 additions & 2 deletions src/screens/Contacts/AddContact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const AddContact = ({

try {
parse(contactUrl);
} catch (e) {
} catch (_e) {
setError(t('contact_error_key'));
return;
}
Expand All @@ -60,7 +60,7 @@ const AddContact = ({
setError(t('contact_error_yourself'));
return;
}
} catch (e) {}
} catch (_e) {}

const onError = (): void => {
setError(t('contact_error_key'));
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Contacts/ContactEdit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const ContactEdit = ({
const myProfile = useMemo(() => {
try {
return parse(myProfileUrl).id === parse(url).id;
} catch (e) {
} catch (_e) {
return false;
}
}, [myProfileUrl, url]);
Expand Down
2 changes: 1 addition & 1 deletion src/screens/Settings/ElectrumConfig/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ const isValidURL = (data: string): boolean => {
}

return isValidDomainOrIP;
} catch (e) {
} catch (_e) {
// If URL constructor fails, it's not a valid URL
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/store/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ const migrations = {
for (const key of keys) {
mmkv.delete(key);
}
} catch (e) {}
} catch (_e) {}

return state;
},
Expand Down
2 changes: 1 addition & 1 deletion src/store/utils/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const wipeApp = async ({
try {
const wallet = getOnChainWallet();
await wallet.stop();
} catch (e) {}
} catch (_e) {}

// Reset Redux stores & persisted storage
dispatch({ type: actions.WIPE_APP });
Expand Down
4 changes: 2 additions & 2 deletions src/utils/conversion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const btcToSats = (balance: number): number => {
.value()
.toFixed(0),
);
} catch (e) {
} catch (_e) {
return 0;
}
};
Expand Down Expand Up @@ -75,7 +75,7 @@ export const fiatToBitcoinUnit = ({
.toFixed(denomination === EDenomination.modern ? 0 : 8); // satoshi cannot be a fractional number

return Number(value);
} catch (e) {
} catch (_e) {
return 0;
}
};
Expand Down
15 changes: 1 addition & 14 deletions src/utils/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,19 +191,6 @@ export const capitalize = (text: string): string => {
return text.charAt(0).toUpperCase() + text.slice(1);
};

/**
* Returns the last word in a string.
* @param {string} phrase
*/
export const getLastWordInString = (phrase: string): string => {
try {
const n = phrase.split(' ');
return n[n.length - 1];
} catch (e) {
return phrase;
}
};

export const roundUpToTwoDecimals = (num: number): number => {
return Math.ceil(num * 100) / 100;
};
Expand Down Expand Up @@ -509,7 +496,7 @@ export const openURL = async (url: string): Promise<boolean> => {
export const openAppURL = async (url: string): Promise<void> => {
try {
await Linking.openURL(url);
} catch (error) {
} catch (_e) {
console.log('Cannot open url: ', url);
}
};
Expand Down
4 changes: 2 additions & 2 deletions src/utils/i18n/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ i18nICU
try {
// @ts-ignore __setDefaultTimeZone doesn't exist in native API
Intl.DateTimeFormat.__setDefaultTimeZone(timeZone);
} catch (e) {
} catch (_e) {
console.log(`error settings timezone to: ${timeZone} fallback to UTC`);
// @ts-ignore __setDefaultTimeZone doesn't exist in native API
Intl.DateTimeFormat.__setDefaultTimeZone('UTC');
Expand All @@ -80,7 +80,7 @@ i18nICU
if (Intl.RelativeTimeFormat.polyfilled) {
await relativeTimeFormatPolyfills[lang]?.();
}
} catch (e) {
} catch (_e) {
console.warn('Error loading polyfill for language: ', lang);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/utils/ignoreLogs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ if (__DEV__) {
let output: string;
try {
output = args.join(' ');
} catch (err) {
} catch (_err) {
// if we can't check if the log should be ignored, just log it
logger(...args);
return;
Expand Down
2 changes: 1 addition & 1 deletion src/utils/lightning/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,5 +173,5 @@ const unlinkIfExists = async (path: string): Promise<void> => {
if (await exists(path)) {
await unlink(path);
}
} catch (e) {}
} catch (_e) {}
};
2 changes: 1 addition & 1 deletion src/utils/wallet/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const getTransactionInputValue = ({
}
}
return 0;
} catch (e) {
} catch (_e) {
return 0;
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/utils/wallet/txdecoder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const classifyOutputScript = (script): string => {
const isOutput = (paymentFn: PaymentFn): bitcoin.Payment | undefined => {
try {
return paymentFn({ output: script });
} catch (e) {}
} catch (_e) {}
};

if (isOutput(bitcoin.payments.p2pk)) {
Expand Down
Loading