build(deps-dev): bump eslint-plugin-react-hooks from 7.0.1 to 7.1.1 in /frontend (#2261)

* build(deps-dev): bump eslint-plugin-react-hooks in /frontend

Bumps [eslint-plugin-react-hooks](https://github.com/facebook/react/tree/HEAD/packages/eslint-plugin-react-hooks) from 7.0.1 to 7.1.1.
- [Release notes](https://github.com/facebook/react/releases)
- [Changelog](https://github.com/facebook/react/blob/main/packages/eslint-plugin-react-hooks/CHANGELOG.md)
- [Commits](https://github.com/facebook/react/commits/eslint-plugin-react-hooks@7.1.1/packages/eslint-plugin-react-hooks)

---
updated-dependencies:
- dependency-name: eslint-plugin-react-hooks
  dependency-version: 7.1.1
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* chore: disable react-hooks set-state-in-effect

* chore: suppress react-hooks set-state-in-render in NewApp

* fix: avoid mutating order before submission

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: im-adithya <imadithyavardhan@gmail.com>
This commit is contained in:
dependabot[bot] 2026-04-27 16:46:41 +05:30 committed by GitHub
parent a4f81fd907
commit ba7d10086e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 18 additions and 21 deletions

View file

@ -30,6 +30,7 @@ export default [
},
files: ["**/*.ts", "**/*.tsx"],
rules: {
"react-hooks/set-state-in-effect": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{

View file

@ -66,7 +66,7 @@
"@vitejs/plugin-react-swc": "^4.3.0",
"eslint": "^10.2.0",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-react-hooks": "^7.0.1",
"eslint-plugin-react-hooks": "^7.1.1",
"eslint-plugin-react-refresh": "^0.5.2",
"globals": "^17.4.0",
"husky": "^9.0.11",

View file

@ -45,7 +45,6 @@ export function FixedFloatSwapInFlow({
useEffect(() => {
if (invoiceData?.settledAt) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setPaymentDone(true);
}
}, [invoiceData]);

View file

@ -18,7 +18,6 @@ export default function RevealPasswordToggle({
// toggle the button if password view is handled by component itself
useEffect(() => {
if (typeof isRevealed !== "undefined") {
// eslint-disable-next-line react-hooks/set-state-in-effect
setRevealed(isRevealed);
}
}, [isRevealed]);

View file

@ -79,7 +79,6 @@ export function ThemeProvider({
prefersDark = darkMode === "dark";
}
// eslint-disable-next-line react-hooks/set-state-in-effect
setIsDarkMode(prefersDark);
if (prefersDark) {

View file

@ -103,6 +103,7 @@ const NewAppInternal = ({ capabilities }: NewAppInternalProps) => {
const reqMethodsParam = queryParams.get("request_methods") ?? "";
const notificationTypesParam = queryParams.get("notification_types") ?? "";
/* eslint-disable react-hooks/preserve-manual-memoization */
const initialScopes: Scope[] = React.useMemo(() => {
const methods = reqMethodsParam
? reqMethodsParam.split(" ")
@ -115,6 +116,7 @@ const NewAppInternal = ({ capabilities }: NewAppInternalProps) => {
(method) => capabilities.methods.indexOf(method) < 0
);
if (unsupportedMethods.length) {
// eslint-disable-next-line react-hooks/set-state-in-render
setUnsupportedError(
"This app requests methods not supported by your wallet: " +
unsupportedMethods
@ -137,6 +139,7 @@ const NewAppInternal = ({ capabilities }: NewAppInternalProps) => {
capabilities.notificationTypes.indexOf(notificationType) < 0
);
if (unsupportedNotificationTypes.length) {
// eslint-disable-next-line react-hooks/set-state-in-render
setUnsupportedError(
"This app requests notification types not supported by your wallet: " +
unsupportedNotificationTypes
@ -188,6 +191,7 @@ const NewAppInternal = ({ capabilities }: NewAppInternalProps) => {
notificationTypesParam,
reqMethodsParam,
]);
/* eslint-enable react-hooks/preserve-manual-memoization */
const parseExpiresParam = (expiresParam: string): Date | undefined => {
const expiresParamTimestamp = parseInt(expiresParam);

View file

@ -168,6 +168,8 @@ function NewChannelInternal({
function onSubmit(e: FormEvent) {
e.preventDefault();
try {
const nextOrder: Partial<LightningOrder> = { ...order };
if (!showAdvanced) {
if (!channelPeerSuggestions) {
throw new Error("Channel Peer suggestions not loaded");
@ -187,18 +189,15 @@ function NewChannelInternal({
});
return;
}
order.paymentMethod = "lightning";
if (
order.paymentMethod !== "lightning" ||
bestPartner.paymentMethod !== "lightning"
) {
throw new Error("Unexpected order or partner payment method");
nextOrder.paymentMethod = "lightning";
if (bestPartner.paymentMethod !== "lightning") {
throw new Error("Unexpected partner payment method");
}
order.lspType = bestPartner.type;
order.lspIdentifier = bestPartner.identifier;
nextOrder.lspType = bestPartner.type;
nextOrder.lspIdentifier = bestPartner.identifier;
}
useChannelOrderStore.getState().setOrder(order as NewChannelOrder);
useChannelOrderStore.getState().setOrder(nextOrder as NewChannelOrder);
navigate("/channels/order");
} catch (error) {
toast.error("Something went wrong", {

View file

@ -68,7 +68,6 @@ export default function DepositBitcoin() {
if (txId) {
const utxo = mempoolAddressUtxos.find((utxo) => utxo.txid === txId);
if (utxo?.status.confirmed) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setConfirmedAmount(utxo.value);
setPendingAmount(null);
}

View file

@ -65,7 +65,6 @@ export default function ReceiveOnchain() {
useEffect(() => {
const newTabValue = searchParams.get("type");
if (newTabValue) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setTab(newTabValue);
setSearchParams({});
}
@ -138,7 +137,6 @@ function ReceiveToOnchain() {
if (txId) {
const utxo = mempoolAddressUtxos.find((utxo) => utxo.txid === txId);
if (utxo?.status.confirmed) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setConfirmedAmount(utxo.value);
setPendingAmount(null);
}

View file

@ -48,7 +48,6 @@ export default function Swap() {
useEffect(() => {
const newTabValue = searchParams.get("type");
if (newTabValue) {
// eslint-disable-next-line react-hooks/set-state-in-effect
setTab(newTabValue);
setSearchParams({});
}

View file

@ -3466,10 +3466,10 @@ eslint-config-prettier@^10.1.8:
resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz#15734ce4af8c2778cc32f0b01b37b0b5cd1ecb97"
integrity sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==
eslint-plugin-react-hooks@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.0.1.tgz#66e258db58ece50723ef20cc159f8aa908219169"
integrity sha512-O0d0m04evaNzEPoSW+59Mezf8Qt0InfgGIBJnpC0h3NH/WjUAR7BIKUfysC6todmtiZ/A0oUVS8Gce0WhBrHsA==
eslint-plugin-react-hooks@^7.1.1:
version "7.1.1"
resolved "https://registry.yarnpkg.com/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-7.1.1.tgz#e6742cad75d970c0a3f30d7d3fa80a4784f55927"
integrity sha512-f2I7Gw6JbvCexzIInuSbZpfdQ44D7iqdWX01FKLvrPgqxoE7oMj8clOfto8U6vYiz4yd5oKu39rRSVOe1zRu0g==
dependencies:
"@babel/core" "^7.24.4"
"@babel/parser" "^7.24.4"