diff --git a/.eslintrc.json b/.eslintrc.json index 88a93d4e8..7c166eeee 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -27,6 +27,14 @@ } ] } + ], + "@typescript-eslint/no-unused-vars": [ + "warn", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrorsIgnorePattern": "^_" + } ] } } diff --git a/packages/cketh/src/minter.canister.spec.ts b/packages/cketh/src/minter.canister.spec.ts index c3df12654..8ccf3bece 100644 --- a/packages/cketh/src/minter.canister.spec.ts +++ b/packages/cketh/src/minter.canister.spec.ts @@ -278,8 +278,7 @@ describe("ckETH minter canister", () => { expect(service.withdraw_erc20).toBeCalledTimes(1); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { address, ledgerCanisterId, ...rest } = params; + const { address, ledgerCanisterId: _, ...rest } = params; expect(service.withdraw_erc20).toBeCalledWith({ recipient: address, ckerc20_ledger_id: ledgerCanisterIdMock, @@ -307,8 +306,7 @@ describe("ckETH minter canister", () => { expect(service.withdraw_erc20).toBeCalledTimes(1); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { address, ledgerCanisterId, ...rest } = params; + const { address, ledgerCanisterId: _, ...rest } = params; expect(service.withdraw_erc20).toHaveBeenCalledWith({ recipient: address, ckerc20_ledger_id: ledgerCanisterIdMock, @@ -331,8 +329,7 @@ describe("ckETH minter canister", () => { expect(service.withdraw_erc20).toBeCalledTimes(1); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { address, ledgerCanisterId, ...rest } = params; + const { address, ledgerCanisterId: _, ...rest } = params; expect(service.withdraw_erc20).toHaveBeenCalledWith({ recipient: address, ckerc20_ledger_id: ledgerCanisterIdMock, @@ -356,8 +353,7 @@ describe("ckETH minter canister", () => { expect(service.withdraw_erc20).toBeCalledTimes(1); - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { address, ledgerCanisterId, ...rest } = params; + const { address, ledgerCanisterId: _, ...rest } = params; expect(service.withdraw_erc20).toHaveBeenCalledWith({ recipient: address, ckerc20_ledger_id: ledgerCanisterIdMock, diff --git a/packages/ic-management/README.md b/packages/ic-management/README.md index 92fa8e07f..efa5cbe89 100644 --- a/packages/ic-management/README.md +++ b/packages/ic-management/README.md @@ -94,7 +94,7 @@ Create a new canister | ---------------- | ------------------------------------------------------------------------------------- | | `createCanister` | `({ settings, senderCanisterVersion, }?: CreateCanisterParams) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L83) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L82) ##### :gear: updateSettings @@ -104,7 +104,7 @@ Update canister settings | ---------------- | ------------------------------------------------------------------------------------------- | | `updateSettings` | `({ canisterId, senderCanisterVersion, settings, }: UpdateSettingsParams) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L106) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L105) ##### :gear: installCode @@ -114,7 +114,7 @@ Install code to a canister | ------------- | -------------------------------------------------------------------------------------------------- | | `installCode` | `({ canisterId, wasmModule, senderCanisterVersion, ...rest }: InstallCodeParams) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L131) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L130) ##### :gear: uploadChunk @@ -129,7 +129,7 @@ Parameters: - `params.canisterId`: The canister in which the chunks will be stored. - `params.chunk`: A chunk of Wasm module. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L157) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L156) ##### :gear: clearChunkStore @@ -143,7 +143,7 @@ Parameters: - `params.canisterId`: The canister in which the chunks are stored. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L177) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L176) ##### :gear: storedChunks @@ -157,7 +157,7 @@ Parameters: - `params.canisterId`: The canister in which the chunks are stored. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L196) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L195) ##### :gear: installChunkedCode @@ -177,7 +177,7 @@ Parameters: - `params.storeCanisterId`: Specifies the canister in whose chunk storage the chunks are stored (this parameter defaults to target_canister if not specified). - `params.wasmModuleHash`: The Wasm module hash as hex string. Used to check that the SHA-256 hash of wasm_module is equal to the wasm_module_hash parameter and can calls install_code with parameters. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L221) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L220) ##### :gear: uninstallCode @@ -187,7 +187,7 @@ Uninstall code from a canister | --------------- | -------------------------------------------------------------------------------- | | `uninstallCode` | `({ canisterId, senderCanisterVersion, }: UninstallCodeParams) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L252) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L251) ##### :gear: startCanister @@ -197,7 +197,7 @@ Start a canister | --------------- | ------------------------------------------ | | `startCanister` | `(canisterId: Principal) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L270) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L269) ##### :gear: stopCanister @@ -207,7 +207,7 @@ Stop a canister | -------------- | ------------------------------------------ | | `stopCanister` | `(canisterId: Principal) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L282) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L281) ##### :gear: canisterStatus @@ -217,7 +217,7 @@ Get canister details (memory size, status, etc.) | ---------------- | ------------------------------------------------------------ | | `canisterStatus` | `(canisterId: Principal) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L293) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L292) ##### :gear: deleteCanister @@ -227,7 +227,7 @@ Deletes a canister | ---------------- | ------------------------------------------ | | `deleteCanister` | `(canisterId: Principal) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L307) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L306) ##### :gear: provisionalCreateCanisterWithCycles @@ -237,7 +237,7 @@ Creates a canister. Only available on development instances. | ------------------------------------- | ------------------------------------------------------------------------------------------------------- | | `provisionalCreateCanisterWithCycles` | `({ settings, amount, canisterId, }?: ProvisionalCreateCanisterWithCyclesParams) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L322) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L321) ##### :gear: fetchCanisterLogs @@ -247,7 +247,7 @@ Given a canister ID as input, this method returns a vector of logs of that canis | ------------------- | ---------------------------------------------------------------- | | `fetchCanisterLogs` | `(canisterId: Principal) => Promise` | -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L345) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L344) ##### :gear: takeCanisterSnapshot @@ -265,7 +265,7 @@ Parameters: Can be provided as a `string` or a `Uint8Array`. If not provided, a new snapshot will be created. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L371) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L370) ##### :gear: listCanisterSnapshots @@ -280,7 +280,7 @@ Parameters: - `params`: - Parameters for the listing operation. - `params.canisterId`: - The ID of the canister for which snapshots will be listed. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L400) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L399) ##### :gear: loadCanisterSnapshot @@ -297,7 +297,7 @@ Parameters: - `params.snapshotId`: - The ID of the snapshot to load. - `params.senderCanisterVersion`: - The optional sender canister version. If provided, its value must be equal to ic0.canister_version. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L426) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L425) ##### :gear: deleteCanisterSnapshot @@ -313,7 +313,7 @@ Parameters: - `params.canisterId`: - The ID of the canister for which the snapshot will be deleted. - `params.snapshotId`: - The ID of the snapshot to delete. -[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L457) +[:link: Source](https://github.com/dfinity/ic-js/tree/main/packages/ic-management/src/ic-management.canister.ts#L456) diff --git a/packages/ic-management/src/ic-management.canister.ts b/packages/ic-management/src/ic-management.canister.ts index 5dfc3cdd6..8bef5ba04 100644 --- a/packages/ic-management/src/ic-management.canister.ts +++ b/packages/ic-management/src/ic-management.canister.ts @@ -46,7 +46,6 @@ export class ICManagementCanister { const transform = ( _methodName: string, args: unknown[], - // eslint-disable-next-line @typescript-eslint/no-unused-vars _callConfig: CallConfig, ) => { const first = args[0] as { canister_id: string }; diff --git a/packages/ledger-icrc/src/utils/payment.utils.ts b/packages/ledger-icrc/src/utils/payment.utils.ts index bc383bfdb..81f44ed0c 100644 --- a/packages/ledger-icrc/src/utils/payment.utils.ts +++ b/packages/ledger-icrc/src/utils/payment.utils.ts @@ -34,7 +34,6 @@ export const decodePayment = ( return undefined; } - // eslint-disable-next-line @typescript-eslint/no-unused-vars const [_, token, identifier, amount] = match; return {