Skip to content

Commit 25c98f6

Browse files
committed
chore: no used variables
1 parent b26f0c1 commit 25c98f6

File tree

14 files changed

+19
-29
lines changed

14 files changed

+19
-29
lines changed

biome.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
"noBannedTypes": "off",
99
"noForEach": "off"
1010
},
11+
"correctness": {
12+
"noUnusedFunctionParameters": "error",
13+
"noUnusedVariables": "error"
14+
},
1115
"performance": {
1216
"noAccumulatingSpread": "off"
1317
},

src/screens/Activity/ActivityDetail.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,6 @@ const OnchainActivityDetail = ({
164164
const dispatch = useAppDispatch();
165165
const contacts = useAppSelector(contactsSelector);
166166
const tags = useAppSelector((state) => tagSelector(state, id));
167-
const selectedNetwork = useAppSelector(selectedNetworkSelector);
168167
const activityItems = useAppSelector(activityItemsSelector);
169168
const boostedTransactions = useAppSelector(boostedTransactionsSelector);
170169
const transfer = useAppSelector((state) => {

src/screens/Contacts/AddContact.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const AddContact = ({
5050

5151
try {
5252
parse(contactUrl);
53-
} catch (e) {
53+
} catch (_e) {
5454
setError(t('contact_error_key'));
5555
return;
5656
}
@@ -60,7 +60,7 @@ const AddContact = ({
6060
setError(t('contact_error_yourself'));
6161
return;
6262
}
63-
} catch (e) {}
63+
} catch (_e) {}
6464

6565
const onError = (): void => {
6666
setError(t('contact_error_key'));

src/screens/Contacts/ContactEdit.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ const ContactEdit = ({
4545
const myProfile = useMemo(() => {
4646
try {
4747
return parse(myProfileUrl).id === parse(url).id;
48-
} catch (e) {
48+
} catch (_e) {
4949
return false;
5050
}
5151
}, [myProfileUrl, url]);

src/screens/Settings/ElectrumConfig/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const isValidURL = (data: string): boolean => {
6767
}
6868

6969
return isValidDomainOrIP;
70-
} catch (e) {
70+
} catch (_e) {
7171
// If URL constructor fails, it's not a valid URL
7272
return false;
7373
}

src/store/migrations/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ const migrations = {
7676
for (const key of keys) {
7777
mmkv.delete(key);
7878
}
79-
} catch (e) {}
79+
} catch (_e) {}
8080

8181
return state;
8282
},

src/store/utils/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const wipeApp = async ({
3535
try {
3636
const wallet = getOnChainWallet();
3737
await wallet.stop();
38-
} catch (e) {}
38+
} catch (_e) {}
3939

4040
// Reset Redux stores & persisted storage
4141
dispatch({ type: actions.WIPE_APP });

src/utils/conversion.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export const btcToSats = (balance: number): number => {
1313
.value()
1414
.toFixed(0),
1515
);
16-
} catch (e) {
16+
} catch (_e) {
1717
return 0;
1818
}
1919
};
@@ -75,7 +75,7 @@ export const fiatToBitcoinUnit = ({
7575
.toFixed(denomination === EDenomination.modern ? 0 : 8); // satoshi cannot be a fractional number
7676

7777
return Number(value);
78-
} catch (e) {
78+
} catch (_e) {
7979
return 0;
8080
}
8181
};

src/utils/helpers.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -191,19 +191,6 @@ export const capitalize = (text: string): string => {
191191
return text.charAt(0).toUpperCase() + text.slice(1);
192192
};
193193

194-
/**
195-
* Returns the last word in a string.
196-
* @param {string} phrase
197-
*/
198-
export const getLastWordInString = (phrase: string): string => {
199-
try {
200-
const n = phrase.split(' ');
201-
return n[n.length - 1];
202-
} catch (e) {
203-
return phrase;
204-
}
205-
};
206-
207194
export const roundUpToTwoDecimals = (num: number): number => {
208195
return Math.ceil(num * 100) / 100;
209196
};
@@ -509,7 +496,7 @@ export const openURL = async (url: string): Promise<boolean> => {
509496
export const openAppURL = async (url: string): Promise<void> => {
510497
try {
511498
await Linking.openURL(url);
512-
} catch (error) {
499+
} catch (_e) {
513500
console.log('Cannot open url: ', url);
514501
}
515502
};

src/utils/i18n/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ i18nICU
5454
try {
5555
// @ts-ignore __setDefaultTimeZone doesn't exist in native API
5656
Intl.DateTimeFormat.__setDefaultTimeZone(timeZone);
57-
} catch (e) {
57+
} catch (_e) {
5858
console.log(`error settings timezone to: ${timeZone} fallback to UTC`);
5959
// @ts-ignore __setDefaultTimeZone doesn't exist in native API
6060
Intl.DateTimeFormat.__setDefaultTimeZone('UTC');
@@ -80,7 +80,7 @@ i18nICU
8080
if (Intl.RelativeTimeFormat.polyfilled) {
8181
await relativeTimeFormatPolyfills[lang]?.();
8282
}
83-
} catch (e) {
83+
} catch (_e) {
8484
console.warn('Error loading polyfill for language: ', lang);
8585
}
8686
});

0 commit comments

Comments
 (0)