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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
"@types/node-fetch": "^2.6.12",
"babel-jest": "30.0.0",
"depcheck": "^1.4.7",
"eslint": "^9.34.0",
"eslint": "^9.37.0",
"husky": "^9.1.7",
"jest": "29.7.0",
"jest-environment-node": "^29.7.0",
Expand Down
10 changes: 5 additions & 5 deletions packages/eslint/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
"type-check": "yarn g:tsc --build"
},
"devDependencies": {
"@eslint/js": "^9.34.0",
"eslint": "^9.34.0",
"@eslint/js": "^9.37.0",
"eslint": "^9.37.0",
"eslint-plugin-chai-friendly": "^1.1.0",
"eslint-plugin-import": "^2.32.0",
"eslint-plugin-jest": "^29.0.1",
"eslint-plugin-jsx-a11y": "^6.10.2",
"eslint-plugin-local-rules": "^3.0.2",
"eslint-plugin-playwright": "^2.2.0",
"eslint-plugin-react": "^7.37.5",
"eslint-plugin-react-hooks": "^5.2.0",
"globals": "^16.3.0",
"typescript-eslint": "^8.42.0"
"eslint-plugin-react-hooks": "^6.1.1",
"globals": "^16.4.0",
"typescript-eslint": "^8.46.0"
}
}
2 changes: 1 addition & 1 deletion packages/eslint/src/reactConfig.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ export const reactConfig = [
},

// React Hooks
...pluginReactHooks.configs.recommended,
{
plugins: { 'react-hooks': pluginReactHooks },
rules: {
...pluginReactHooks.configs.recommended.rules,
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
},
Expand Down
2 changes: 1 addition & 1 deletion packages/product-components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"@trezor/utils": "workspace:*",
"framer-motion": "^12.23.3",
"react": "19.0.0",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"react-intl": "^7.1.11",
"react-svg": "16.3.0",
"styled-components": "^6.1.19",
Expand Down
6 changes: 3 additions & 3 deletions packages/suite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@floating-ui/react": "^0.27.12",
"@formatjs/intl": "3.1.6",
"@hookform/resolvers": "^5.2.1",
"@hookform/resolvers": "^5.2.2",
"@mobily/ts-belt": "^3.13.1",
"@reduxjs/toolkit": "2.8.2",
"@sentry/core": "8.55.0",
Expand Down Expand Up @@ -112,10 +112,10 @@
"react-error-boundary": "^6.0.0",
"react-focus-lock": "^2.13.6",
"react-helmet-async": "^2.0.5",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"react-intl": "^7.1.11",
"react-redux": "9.2.0",
"react-router": "^7.8.2",
"react-router": "^7.9.3",
"react-select": "^5.10.2",
"react-toastify": "^10.0.4",
"react-use": "^17.6.0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ socks-proxy-agent
stream-browserify
swr
tailwindcss
tar
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only used in script connect-bump-versions.ts so I'm reassigning this to connect team

terser-webpack-plugin
tiny-worker
ts-mixer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ react-hook-form
react-router
rimraf
sort-package-json
tar
tiny-secp256k1
typeforce
typescript-eslint
Expand Down
2 changes: 1 addition & 1 deletion scripts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"@trezor/eslint": "workspace:*",
"@types/semver": "^7.7.0",
"semver": "^7.7.1",
"tar": "^7.0.1"
"tar": "^7.5.1"
}
}
2 changes: 1 addition & 1 deletion suite-common/wallet-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"@trezor/utils": "workspace:*",
"date-fns": "^4.1.0",
"react": "19.0.0",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"react-redux": "^9.2.0",
"web3-utils": "^4.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion suite-common/wallet-utils/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"@trezor/utils": "workspace:*",
"date-fns": "^4.1.0",
"react": "19.0.0",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"web3-eth-abi": "^4.4.1",
"web3-utils": "^4.3.1"
}
Expand Down
2 changes: 1 addition & 1 deletion suite-native/accounts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@trezor/styles": "workspace:*",
"jotai": "2.13.1",
"react": "19.0.0",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"react-native": "0.79.3",
"react-native-reanimated": "^3.18.0",
"react-redux": "9.2.0"
Expand Down
4 changes: 2 additions & 2 deletions suite-native/forms/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
"type-check": "yarn g:tsc --build"
},
"dependencies": {
"@hookform/resolvers": "^5.2.1",
"@hookform/resolvers": "^5.2.2",
"@mobily/ts-belt": "^3.13.1",
"@suite-native/atoms": "workspace:*",
"@suite-native/icons": "workspace:*",
"react": "19.0.0",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"react-native": "0.79.3",
"react-native-reanimated": "^3.18.0",
"type-fest": "4.24.0",
Expand Down
2 changes: 1 addition & 1 deletion suite-native/forms/src/Form.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ReactNode, createContext } from 'react';
import { FieldValues, UseFormReturn } from 'react-hook-form';

export type { FieldValues, Path, UseFormReturn } from 'react-hook-form';
export type { FieldValues, Path, UseFormReturn, FieldPathValue } from 'react-hook-form';

export interface FormProps<TFieldValues extends FieldValues> {
children?: ReactNode;
Expand Down
2 changes: 1 addition & 1 deletion suite-native/module-accounts-import/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"@trezor/utils": "workspace:*",
"@trezor/utxo-lib": "workspace:*",
"react": "19.0.0",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"react-native": "0.79.3",
"react-native-reanimated": "^3.18.0",
"react-redux": "9.2.0"
Expand Down
2 changes: 1 addition & 1 deletion suite-native/module-send/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"@trezor/utils": "workspace:*",
"jotai": "2.13.1",
"react": "19.0.0",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"react-native": "0.79.3",
"react-native-reanimated": "^3.18.0",
"react-native-svg": "15.12.1",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,27 @@
import { useCallback } from 'react';
import { Dispatch, useCallback } from 'react';

import type { Path, UseFormReturn } from '@suite-native/forms';
import type { FieldPathValue, Path, UseFormReturn } from '@suite-native/forms';

import { useBottomSheetControls } from './useBottomSheetControls';
import { BuyFormValues } from '../../types/buy';
import { ExchangeFormValues } from '../../types/exchange';
import { SellFormValues } from '../../types/sell';

export const useSheetControls = <
FormValues extends BuyFormValues | ExchangeFormValues | SellFormValues,
type BottomSheetControls = ReturnType<typeof useBottomSheetControls>;
type FormUnion = BuyFormValues | ExchangeFormValues | SellFormValues;
// explicit return type declaration, because typescript reaches its limits when trying to infer type
Copy link
Copy Markdown
Contributor Author

@Lemonexe Lemonexe Oct 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

after bumping react-hook-form, TS blew on me at useSheetControls:

TS5088: The inferred type of 'useSheetControls' references a type with a cyclic structure which cannot be trivially serialized. A type annotation is necessary.
TS7056: The inferred type of this node exceeds the maximum length the compiler will serialize. An explicit type annotation is needed.

Consultation with GPT-5 told me I should explicitly define return type, as TS can no longer handle the complexity of the inferred type. After a bit of tinkering, this satisfies TS. But I cannot say I understand these types, the labyrinth of generic types in the react-hook-form library confuses the hell out of me 😆

type SheetControls<
FormValues extends FormUnion,
Key extends Path<FormValues>,
>(
> = BottomSheetControls & {
selectedValue: FieldPathValue<FormValues, Key>;
setSelectedValue: Dispatch<FieldPathValue<FormValues, Key>>;
};

export const useSheetControls = <FormValues extends FormUnion, Key extends Path<FormValues>>(
{ setValue, watch }: UseFormReturn<FormValues>,
key: Key,
) => {
): SheetControls<FormValues, Key> => {
const bottomSheetControls = useBottomSheetControls();

const selectedValue = watch(key);
Expand Down
2 changes: 1 addition & 1 deletion suite-native/transaction-management/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"@trezor/utils": "workspace:*",
"expo-linear-gradient": "~14.1.5",
"react": "19.0.0",
"react-hook-form": "^7.62.0",
"react-hook-form": "^7.64.0",
"react-native": "0.79.3",
"react-native-reanimated": "^3.18.0",
"react-redux": "9.2.0"
Expand Down
Loading