Skip to content

Commit

Permalink
lint: fix final rules
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioVentilii-DFINITY committed Sep 27, 2024
1 parent 88d6df5 commit 22e0a55
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions scripts/build.copy-workers.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ await cp(
filter: (source) => extname(source) !== '.map'
},
(err) => {
// TODO: Remove ESLint exception and use nullish checks
// eslint-disable-next-line local-rules/use-nullish-checks
if (err === null) {
return;
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/build.tokens.ckerc20.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AnonymousIdentity } from '@dfinity/agent';
import { CkETHOrchestratorCanister } from '@dfinity/cketh';
import { IcrcLedgerCanister } from '@dfinity/ledger-icrc';
import { Principal } from '@dfinity/principal';
import { createAgent, fromNullable, isNullish, jsonReplacer } from '@dfinity/utils';
import { createAgent, fromNullable, isNullish, jsonReplacer, nonNullish } from '@dfinity/utils';
import { existsSync, writeFileSync } from 'node:fs';
import { join } from 'node:path';

Expand Down Expand Up @@ -74,7 +74,7 @@ const buildOrchestratorInfo = async (orchestratorId) => {

const assertUniqueTokenSymbol = Object.values(tokens).find((value) => value.length > 1);

if (assertUniqueTokenSymbol !== undefined) {
if (nonNullish(assertUniqueTokenSymbol)) {
throw new Error(
`More than one pair of ledger and index canisters were used for the token symbol ${assertUniqueTokenSymbol}.`
);
Expand Down
1 change: 1 addition & 0 deletions src/frontend/src/icp-eth/services/cketh.services.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const loadCkEthMinterInfo = async ({
const minterInfoInStore = get(ckEthMinterInfoStore);

// We try to load only once per session the helpers (ckETH and ckErc20) contract addresses
// eslint-disable-next-line local-rules/use-nullish-checks -- We want to check for not-undefined values but null is allowed
if (minterInfoInStore?.[tokenId] !== undefined) {
return;
}
Expand Down
4 changes: 3 additions & 1 deletion src/frontend/src/lib/utils/route.utils.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { nonNullish } from '@dfinity/utils';

/**
* Update browser URL. To be use only for really particular use case that do not include navigation and loading data.
*/
Expand All @@ -15,6 +17,6 @@ export const replaceHistory = (url: URL) => {
* Source: https://stackoverflow.com/a/6825002/5404186
*/
const supportsHistory = (): boolean =>
window.history !== undefined &&
nonNullish(window.history) &&
'pushState' in window.history &&
typeof window.history.pushState !== 'undefined';

0 comments on commit 22e0a55

Please sign in to comment.