✨ (chore) [NO-ISSUE]: Add no-magic-numbers ESLint rule and fix all violations#1370
Open
aussedatlo wants to merge 4 commits intodevelopfrom
Open
✨ (chore) [NO-ISSUE]: Add no-magic-numbers ESLint rule and fix all violations#1370aussedatlo wants to merge 4 commits intodevelopfrom
aussedatlo wants to merge 4 commits intodevelopfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
Contributor
pdeville-ledger
approved these changes
Mar 18, 2026
f66fc1e to
1a727c0
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the shared ESLint config to enforce @typescript-eslint/no-magic-numbers (as an error) and applies a large-scale refactor across the monorepo to replace inline numeric literals with named constants.
Changes:
- Enable
@typescript-eslint/no-magic-numbers(error) in the shared ESLint config and disable the baseno-magic-numbers. - Refactor many packages to extract numeric literals into named constants (protocol bytes, lengths, masks, timeouts, etc.).
- Add multiple changesets for patch releases across impacted packages.
Reviewed changes
Copilot reviewed 200 out of 200 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/trusted-apps/ledger-keyring-protocol/src/internal/utils/derivationPath.ts | Replace derivation-path numeric literals with named constants |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/utils/TLVParser.ts | Replace numeric literals with constants for TLV parsing/formatting |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/utils/LKRPCommand.ts | Replace numeric literals with constants (byte lengths, hex formatting) |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/utils/LKRPBlockStream.ts | Replace numeric literals with constants (hash/key lengths) |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/utils/LKRPBlock.ts | Replace numeric literals with constants (signature slicing) |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/use-cases/authentication/EncryptDataUseCase.ts | Replace IV length literal with constant |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/use-cases/authentication/DecryptDataUseCase.ts | Replace field-length literals with constants |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/models/Tags.ts | Replace bit shifts / tag bases with named constants |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/lkrp-datasource/data/HttpLKRPDataSource.ts | Replace HTTP status codes with named constants |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/app-binder/task/SignChallengeWithKeypairTask.ts | Replace TLV tag IDs / counts with named constants |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/app-binder/command/utils/extractTrustedProperty.ts | Replace TLV tag IDs with named constants |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/app-binder/command/SignBlockSignatureCommand.ts | Replace minimum response length literal with constant |
| packages/trusted-apps/ledger-keyring-protocol/src/internal/app-binder/command/SignBlockHeader.ts | Replace placeholder array leading byte with constant |
| packages/trusted-apps/ledger-keyring-protocol/src/api/model/Permissions.ts | Replace shift amount with named constant |
| packages/trusted-apps/ledger-keyring-protocol/src/api/model/Errors.ts | Replace hex formatting literals with constants |
| packages/transport/web-hid/src/api/transport/WebHidTransport.ts | Replace hex radix and product-id shift literals with constants |
| packages/transport/web-hid/src/api/transport/WebHidApduSender.ts | Replace channel generation literals with constants |
| packages/transport/web-ble/src/api/transport/WebBleTransport.ts | Replace timeouts/delays with named constants |
| packages/transport/web-ble/src/api/transport/WebBleApduSender.ts | Replace timing/indices/lengths with named constants |
| packages/transport/speculos/src/internal/datasource/HttpSpeculosDatasource.ts | Replace SSE slice length literal with constant |
| packages/transport/speculos/src/api/SpeculosTransport.ts | Replace device constants and hex slicing lengths with constants |
| packages/transport/rn-ble/src/api/transport/RNBleTransport.ts | Replace intervals/retry counts/error codes with constants |
| packages/transport/rn-ble/src/api/transport/RNBleApduSender.ts | Replace MTU indices/opcode with named constants |
| packages/transport/rn-ble/src/api/permissions/AndroidPermissionsService.ts | Replace API level thresholds with named constants |
| packages/transport/node-hid/src/api/transport/NodeHidTransport.ts | Replace hex radix and product-id shift literals with constants |
| packages/transport/node-hid/src/api/transport/NodeHidApduSender.ts | Replace channel generation/open delay literals with constants |
| packages/transport/mockserver/src/MockserverTransport.ts | Replace device constants and status slicing with constants |
| packages/tools/solana-tools/src/internal/services/TransactionCrafterService.ts | Replace bit masks/shifts/offsets with named constants |
| packages/tools/solana-tools/src/internal/services/GenerateSolanaTransaction.ts | Replace decimal base literal with constant |
| packages/tools/solana-tools/src/internal/app-binder/device-action/GenerateTransactionDeviceAction.ts | Replace default lamports literal with constant |
| packages/tools/cal-interceptor/src/ERC7730Helper.ts | Replace key parts count with constant |
| packages/speculos-device-controller/src/internal/utils/axisClamp.ts | Replace percent clamp literal with constant |
| packages/speculos-device-controller/src/internal/di.ts | Replace default timeout literal with constant |
| packages/speculos-device-controller/src/internal/core/types.ts | Replace percent range size literal with constant type alias |
| packages/speculos-device-controller/src/internal/adapters/DefaultTouchController.ts | Replace percent bounds literal with constant |
| packages/signer/signer-solana/src/internal/app-binder/task/SendSignMessageTask.ts | Replace signature length literal with constant |
| packages/signer/signer-solana/src/internal/app-binder/task/SendSignDataTask.ts | Replace header-size literal with constant |
| packages/signer/signer-solana/src/internal/app-binder/task/ProvideTransactionContextTask.ts | Replace hex parsing literals with named constants |
| packages/signer/signer-solana/src/internal/app-binder/services/TransactionInspector.ts | Replace account key indices with constants |
| packages/signer/signer-solana/src/internal/app-binder/services/OffchainMessageBuilder.ts | Replace KB math/bit masks/shifts with constants |
| packages/signer/signer-solana/src/internal/app-binder/command/SignTransactionCommand.ts | Replace P2 flags with named constants |
| packages/signer/signer-solana/src/internal/app-binder/command/ProvideTLVTransactionInstructionDescriptorCommand.ts | Replace hex-length math / payload max with constants |
| packages/signer/signer-solana/src/internal/app-binder/command/ProvideInstructionDescriptorCommand.ts | Replace hex-length math / payload max with constants |
| packages/signer/signer-solana/src/internal/app-binder/command/GetAppConfigurationCommand.ts | Replace response length and indices with constants |
| packages/signer/signer-hyperliquid/src/internal/app-binder/utils/actionTlvSerializer.ts | Replace DER/bit/BigInt literals with named constants |
| packages/signer/signer-hyperliquid/src/internal/app-binder/command/SignActionsCommand.ts | Replace signature offsets with constants |
| packages/signer/signer-eth/src/internal/typed-data/service/TypedDataParser.ts | Replace regex group indices/size limits with constants |
| packages/signer/signer-eth/src/internal/typed-data/service/TypedDataEncoder.ts | Replace sizes/radix/BigInt literals with constants |
| packages/signer/signer-eth/src/internal/app-binder/task/SendSignTransactionTask.ts | Replace slice counts/bit shifts/EIP155 constants |
| packages/signer/signer-eth/src/internal/app-binder/task/SendEIP712StructImplemTask.ts | Replace uint16 byte size literal with constant |
| packages/signer/signer-eth/src/internal/app-binder/task/ParseNestedTransactionTask.ts | Replace address length literal with constant |
| packages/signer/signer-eth/src/internal/app-binder/task/BuildSubcontextsTask.ts | Replace address length literal with constant |
| packages/signer/signer-eth/src/internal/app-binder/task/BuildSafeAddressContextTask.ts | Replace expected context count with constant |
| packages/signer/signer-eth/src/internal/app-binder/task/BuildBaseContexts.ts | Replace priority literals with constants |
| packages/signer/signer-eth/src/internal/app-binder/command/StoreTransactionCommand.ts | Replace continuation flag literal with constant |
| packages/signer/signer-eth/src/internal/app-binder/command/SignTransactionCommand.ts | Replace continuation flag literal with constant |
| packages/signer/signer-eth/src/internal/app-binder/command/SignPersonalMessageCommand.ts | Replace continuation flag literal with constant |
| packages/signer/signer-eth/src/internal/app-binder/command/SendEIP712StructDefinitionCommand.ts | Replace bit positions with named constants |
| packages/signer/signer-eth/src/internal/app-binder/command/GetAppConfigurationCommand.ts | Replace flag masks with named constants |
| packages/signer/signer-cosmos/src/internal/app-binder/command/utils/EncodeDerivationPath.ts | Replace derivation-path encoding literals with constants |
| packages/signer/signer-cosmos/src/internal/app-binder/command/GetAddressCommand.ts | Replace pubkey length literal with constant |
| packages/signer/signer-btc/src/internal/wallet/service/DefaultWalletBuilder.ts | Replace HMAC size literal with constant |
| packages/signer/signer-btc/src/internal/utils/Varint.ts | Replace varint prefixes/limits with constants |
| packages/signer/signer-btc/src/internal/psbt/service/psbt/DefaultPsbtV2Normalizer.ts | Replace PSBT version literal with constant |
| packages/signer/signer-btc/src/internal/psbt/service/psbt/DefaultPsbtSerializer.ts | Replace PSBT magic bytes with named constants |
| packages/signer/signer-btc/src/internal/psbt/model/Psbt.ts | Replace key prefix length literal with constant |
| packages/signer/signer-btc/src/internal/merkle-tree/service/MerkleTreeBuilder.ts | Replace hash size/base literals with constants |
| packages/signer/signer-btc/src/internal/app-binder/task/UpdatePsbtTask.ts | Replace witness stack count with constant |
| packages/signer/signer-btc/src/internal/app-binder/task/SignPsbtTask.ts | Replace aggregated pubkey index with constant |
| packages/signer/signer-btc/src/internal/app-binder/task/SignMessageTask.ts | Replace hex formatting literals with constants |
| packages/signer/signer-btc/src/internal/app-binder/task/RegisterWalletTask.ts | Replace hex formatting literals with constants |
| packages/signer/signer-btc/src/internal/app-binder/task/ExtractTransactionTask.ts | Replace BigInt zero literal with constant |
| packages/signer/signer-btc/src/internal/app-binder/command/utils/constants.ts | Replace SW bytes with named constant(s) |
| packages/signer/signer-btc/src/internal/app-binder/command/client-command-handlers/GetPreimageCommandHandler.ts | Replace slice offsets with constants |
| packages/signer/signer-btc/src/internal/app-binder/command/client-command-handlers/GetMerkleLeafIndexCommandHandler.ts | Replace slice math with named constants |
| packages/signer/signer-aleo/src/internal/app-binder/command/utils/apduHeaderUtils.ts | Adjust APDU header constant declarations |
| packages/signer/signer-aleo/src/internal/app-binder/command/GetAppConfigCommand.ts | Replace version index literal with constant |
| packages/signer/context-module/src/uniswap/data/DefaultCommandDecoderDataSource.ts | Replace hex-length math with byte-based constants |
| packages/signer/context-module/src/typed-data/domain/DefaultTypedDataContextLoader.ts | Replace selector length, hex formatting literals with constants |
| packages/signer/context-module/src/typed-data/data/HttpTypedDataDataSource.ts | Replace descriptor slicing + hex formatting literals with constants |
| packages/signer/context-module/src/trusted-name/data/HttpTrustedNameDataSource.ts | Replace hex-length math and radix literals with constants |
| packages/signer/context-module/src/token/data/HttpTokenDataSource.ts | Replace byte lengths / radix / padding literals with constants |
| packages/signer/context-module/src/shared/utils/KeyUsageMapper.ts | Replace key-usage numeric mappings with named constants |
| packages/signer/context-module/src/shared/utils/HexStringUtils.ts | Replace hex formatting length/radix literals with constants |
| packages/signer/context-module/src/pki/data/HttpPkiCertificateDataSource.ts | Replace HTTP status literal with constant |
| packages/signer/context-module/src/gated-signing/data/HttpGatedDescriptorDataSource.ts | Replace hex prefix slicing length with constant |
| packages/signer/context-module/src/external-plugin/data/HttpExternalPluginDataSource.ts | Replace hex prefix slicing length with constant |
| packages/signer/context-module/src/calldata/data/HttpCalldataDescriptorDataSource.ts | Replace hex prefix slicing length with constant |
| packages/mockserver-client/src/MockClient.ts | Replace hex formatting literals with constants |
| packages/ledger-wallet/src/api/customLockScreenUtils/types.ts | Introduce BitsPerPixel type alias |
| packages/ledger-wallet/src/api/customLockScreenUtils/screenSpecs.ts | Reuse BitsPerPixel type in specs |
| packages/ledger-wallet/src/api/customLockScreenUtils/grayscale/pixelDataRenderer.ts | Replace image rendering literals with constants |
| packages/ledger-wallet/src/api/customLockScreenUtils/fit/imageFit.ts | Replace divisor literal with constant |
| packages/ledger-wallet/src/api/customLockScreenUtils/codec/encodeImageForDevice.ts | Replace header/packing math literals with constants |
| packages/ledger-wallet/src/api/customLockScreenUtils/codec/decodeImageFromDevice.ts | Replace header offsets/masks with constants |
| packages/devtools/websocket-server/src/WebSocketServer.ts | Replace server count literal with constant |
| packages/devtools/websocket-connector/src/DevToolsWebSocketConnector.ts | Replace reconnect delay literal with constant |
| packages/devtools/ui/src/screens/logger/logsTable/useScrollLogic.ts | Replace thresholds/ratios with constants |
| packages/devtools/ui/src/screens/logger/logsTable/index.tsx | Replace small-row threshold with constant |
| packages/devtools/ui/src/screens/logger/logsTable/TableHeader.tsx | Replace default min column size with constant |
| packages/devtools/ui/src/screens/logger/logsTable/TableBody.tsx | Replace default min size + even divisor with constants |
| packages/devtools/ui/src/screens/logger/index.tsx | Replace shrink thresholds and JSON indent with constants |
| packages/devtools/ui/src/screens/logger/filterUtils.ts | Replace regex group indices with constants |
| packages/devtools/ui/src/screens/inspector/styles.ts | Replace opacity literal with constant |
| packages/devtools/ui/src/screens/inspector/ApduSender.tsx | Replace hex formatting literals with constants |
| packages/devtools/ui/src/components/DashboardNavigationBar.tsx | Replace disabled opacity literal with constant |
| packages/device-management-kit/src/internal/device-session/model/Frame.ts | Replace JSON indent literal with constant |
| packages/device-management-kit/src/internal/device-session/model/DeviceSessionRefresher.ts | Replace multiplier literal with constant |
| packages/device-management-kit/src/internal/device-session/model/DevicePinger.ts | Replace timeout math literals with constants |
| packages/device-management-kit/src/api/utils/HexaString.ts | Replace hex prefix/radix/byte-length literals with constants |
| packages/device-management-kit/src/api/transport/model/DeviceConnectionStateMachine.ts | Replace busy code high byte literal with constant |
| packages/device-management-kit/src/api/secure-channel/utils.ts | Replace APDU CLA/INS literals with constants |
| packages/device-management-kit/src/api/secure-channel/task/ConnectToSecureChannelTask.ts | Replace min length + toFixed precision literals with constants |
| packages/device-management-kit/src/api/logger-subscriber/service/WebLogsExporterLogger.ts | Replace hex formatting + JSON indent literals with constants |
| packages/device-management-kit/src/api/device-session/utils/FramerUtils.ts | Replace byte math literals with constants |
| packages/device-management-kit/src/api/device-session/service/DefaultApduSenderService.stub.ts | Replace stub frame/channel literals with constants |
| packages/device-management-kit/src/api/device-session/service/DefaultApduReceiverService.stub.ts | Replace stub channel literals with constants |
| packages/device-management-kit/src/api/device-session/ApduResponse.stub.ts | Replace SW1 success literal with constant |
| packages/device-management-kit/src/api/device-model/model/DeviceModel.stub.ts | Replace memory/block/mask literals with constants |
| packages/device-management-kit/src/api/device-model/data/StaticDeviceModelDataSource.ts | Replace device memory/block/mask literals with constants |
| packages/device-management-kit/src/api/device-action/os/ListApps/ListAppsDeviceAction.ts | Replace continuation threshold with constant |
| packages/device-management-kit/src/api/device-action/os/GetDeviceStatus/GetDeviceStatusDeviceAction.ts | Replace polling interval literal with constant |
| packages/device-management-kit/src/api/device-action/os/Const.ts | Replace timeout math literals with constants |
| packages/device-management-kit/src/api/command/utils/CommandUtils.ts | Replace APDU/status-word literals with named constants |
| packages/device-management-kit/src/api/command/os/mocks/GetOsVersionCommand.ts | Replace seFlags leading byte literal with constant |
| packages/device-management-kit/src/api/command/os/SecureElementFlagsParser.ts | Replace flag bit positions and shifts with constants |
| packages/device-management-kit/src/api/command/os/ListAppsCommand.ts | Replace INS + hash length literals with constants |
| packages/device-management-kit/src/api/command/os/GetOsVersionCommand.ts | Replace target-id mask/type + min length literals with constants |
| packages/device-management-kit/src/api/command/os/GetBatteryStatusCommand.ts | Replace bounds and sign-extension shift literals with constants |
| packages/device-management-kit/src/api/apdu/utils/ByteArrayParser.ts | Replace bit sizes / shifts / TLV lengths with constants |
| packages/device-management-kit/src/api/apdu/utils/ByteArrayBuilder.ts | Replace bit sizes / masks / byte sizes with constants |
| packages/device-management-kit/src/api/apdu/utils/ApduBuilder.ts | Replace byte mask literal with constant |
| packages/config/eslint/index.js | Enable @typescript-eslint/no-magic-numbers and disable base rule; disable rule in test files |
| apps/sample/src/utils/crypto.ts | Replace client name slice length with constant |
| apps/sample/src/hooks/useDeviceSessionState.ts | Replace throttle delay literal with constant |
| apps/sample/src/components/SignerAleoView/index.tsx | Replace hex prefix length with constant (still has radix literals) |
| apps/sample/src/components/Sidebar/index.tsx | Replace inactive opacity literal with constant |
| apps/sample/src/components/LedgerKeyringProtocolView/index.tsx | Replace hex prefix slice length with constant |
| apps/sample/src/components/Form.tsx | Replace enum entries divisor with constant |
| apps/sample/src/components/Dropdown.tsx | Replace dropdown offset literal with constant |
| apps/sample/src/components/DeviceActionsView/DeviceActionsList.tsx | Replace unlock timeout math literals with constants |
| apps/sample/src/components/DeviceActionsView/DeviceActionUI.tsx | Replace JSON indent literal with constant |
| apps/sample/src/components/DeviceActionsView/DeviceActionTester.tsx | Replace loading opacity literal with constant |
| apps/sample/src/components/DeviceActionsView/DeviceActionResponse.tsx | Replace JSON indent literal with constant |
| apps/sample/src/components/CustomLockScreenPictureInput/useImageProcessing.ts | Replace hex formatting radix/width with constants |
| apps/sample/src/components/CustomLockScreenPictureInput/styles.ts | Replace disabled opacity literal with constant |
| apps/sample/src/components/CustomLockScreenPictureInput/PictureInput.tsx | Replace debounce delay literal with constant |
| apps/sample/src/components/Copyable.tsx | Replace feedback timeout literal with constant |
| apps/sample/src/components/CommandsView/CommandResponse.tsx | Replace JSON indent literal with constant |
| apps/sample/src/components/ClearSigningView/CalCheckDappDrawer.tsx | Replace loading opacity literal with constant |
| apps/sample/src/components/AvailableDevices/index.tsx | Replace margin-top literal with constant |
| apps/sample/src/components/ApduView/modeBulkApdus/inputValidation.ts | Replace prefix substring length with constant |
| apps/sample/src/components/ApduView/modeApduResponseParser/useApduResponseParser.ts | Replace hex/rand/status-code constants |
| apps/sample/src/components/ApduView/modeApduResponseParser/inputValidation.ts | Replace min response length literal with constant |
| apps/sample/src/components/ApduView/modeApduBuilder/useApduBuilder.ts | Replace random string constants |
| apps/sample/src/components/ApduView/hexUtils.ts | Replace hex formatting constants (still has radix literal in parseInt) |
| apps/sample/playwright.config.ts | Replace timeout math literals with constants |
| apps/mobile/src/components/SendDeviceActionModal.tsx | Replace JSON indent literal with constant |
| apps/mobile/src/components/SendCommandModal.tsx | Replace JSON indent literal with constant |
| apps/mobile/src/components/DeviceActions.tsx | Replace unlock timeout math literals with constants |
| apps/mobile/src/components/ConnectDeviceScreen.tsx | Replace JSON indent literal with constant |
| apps/ldmk-cli/app/handlers/signer/handlers/eth-signer/handlers/SignTransactionEthSignerActionHandler.ts | Replace hex parsing literals with constants |
| apps/ldmk-cli/app/handlers/device-command/handlers/GetBatteryStatusCommandHandler.ts | Replace battery thresholds with constants |
| apps/ldmk-cli/app/handlers/apdu/SendApduActionHandler.ts | Replace hex formatting literals with constants |
| apps/ldmk-cli/app/FrontController.ts | Replace readiness delay literal with constant |
| apps/clear-signing-tester/src/infrastructure/services/AppVersionResolverService.ts | Change selection to stable OS versions only; update error messages |
| apps/clear-signing-tester/src/infrastructure/service-controllers/SpeculosServiceController.ts | Replace UID/GID and init delay literals with constants |
| apps/clear-signing-tester/src/infrastructure/service-controllers/DMKServiceController.ts | Replace retry parameters with constants |
| apps/clear-signing-tester/src/infrastructure/adapters/speculos/SpeculosScreenshotSaver.ts | Replace screenshot delay literal with constant |
| apps/clear-signing-tester/src/infrastructure/adapters/external/HttpEtherscanAdapter.ts | Replace default timeout literal with constant |
| apps/clear-signing-tester/src/infrastructure/adapters/device-controllers/SpeculosTouchscreenController.ts | Replace reject confirmation delay literal with constant |
| apps/clear-signing-tester/src/infrastructure/adapters/device-controllers/SpeculosNanoController.ts | Replace navigation step count with constant |
| apps/clear-signing-tester/src/domain/utils/ResultFormatter.ts | Replace percentage multiplier literal with constant |
| apps/clear-signing-tester/src/cli/EthereumTransactionTesterCli.ts | Replace random port range and max port with constants |
| apps/clear-signing-tester/src/application/usecases/TestContractUseCase.ts | Replace inter-test delay literal with constant |
| apps/clear-signing-tester/src/application/usecases/TestBatchFromFileUseCase.ts | Replace inter-test delay literal with constant |
| apps/clear-signing-tester/src/application/usecases/TestBatchContractFromFileUseCase.ts | Replace inter-test delay literal with constant |
| .changeset/wide-grapes-rule.md | Changeset: patch bump + summary |
| .changeset/silver-papers-think.md | Changeset: patch bump + summary |
| .changeset/salty-chefs-boil.md | Changeset: patch bump + summary |
| .changeset/red-ears-brake.md | Changeset: patch bump + summary |
| .changeset/proud-towns-bathe.md | Changeset: patch bump + summary |
| .changeset/odd-humans-sip.md | Changeset: patch bump + summary |
| .changeset/neat-mice-hope.md | Changeset: patch bump + summary |
| .changeset/mighty-women-invite.md | Changeset: patch bump + summary |
| .changeset/loose-regions-count.md | Changeset: patch bump + summary |
| .changeset/little-llamas-sing.md | Changeset: patch bump + summary |
| .changeset/little-adults-change.md | Changeset: patch bump + summary |
| .changeset/khaki-deer-glow.md | Changeset: patch bump + summary |
| .changeset/icy-teeth-swim.md | Changeset: patch bump + summary |
| .changeset/green-trains-rhyme.md | Changeset: patch bump + summary |
| .changeset/funny-cities-pay.md | Changeset: patch bump + summary |
| .changeset/four-doors-sneeze.md | Changeset: patch bump + summary |
| .changeset/easy-cats-brake.md | Changeset: patch bump + summary |
| .changeset/curly-weeks-report.md | Changeset: patch bump + summary |
| .changeset/curly-rivers-grin.md | Changeset: patch bump + summary |
| .changeset/cool-animals-brush.md | Changeset: patch bump + summary |
| .changeset/bright-nails-obey.md | Changeset: patch bump + summary |
Comments suppressed due to low confidence (1)
apps/sample/src/components/SignerAleoView/index.tsx:133
- This file still contains inline magic numbers for
parseInt(..., 16), which will violate the newly-enabled@typescript-eslint/no-magic-numbersrule (only -1/0/1 are allowed). Consider introducing a localHEX_RADIXconstant (or reusing an existing shared one) and using it for these radix arguments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
145
to
147
| const type = value[0]; | ||
| this.offset -= value.length - 2; // Adjust offset to the start of the command | ||
| this.offset -= value.length - HEX_BYTE_LENGTH; // Adjust offset to the start of the command | ||
| switch (type) { |
Comment on lines
+1
to
+5
| --- | ||
| "@ledgerhq/device-trusted-app-kit-ledger-keyring-protocol": patch | ||
| --- | ||
|
|
||
| Extract magic numbers into named constants |
Comment on lines
1
to
2
| export const ALEO_CLA = 0xe0; | ||
| export const P2_DEFAULT = 0x00 as const; |
Add @typescript-eslint/no-magic-numbers as error in the shared ESLint config, allowing only -1, 0, and 1 as inline numeric literals. Test files are excluded from the rule. Extract all 724 magic numbers across 27 packages into named UPPER_CASE constants. Made-with: Cursor
Made-with: Cursor
Made-with: Cursor
d5ea4a1 to
8c3b7bd
Compare
fAnselmi-Ledger
requested changes
Mar 19, 2026
Made-with: Cursor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
📝 Description
Add the
@typescript-eslint/no-magic-numbersESLint rule to the shared config (@ledgerhq/eslint-config-dsdk) as an error, and fix all 724 violations across the entire monorepo by extracting numeric literals into namedUPPER_CASEconstants.ESLint rule configuration:
-1,0, and1are allowed as inline numeric literals*.test.*,*.spec.*) are excluded from the ruleconstdeclarations (enforceConst: true)Scope of fixes:
❓ Context
✅ Checklist
@typescript-eslint/no-magic-numbersESLint rule added to the shared configMade with Cursor