Skip to content

Commit 25c6487

Browse files
committed
chore: apply fixes
1 parent f482990 commit 25c6487

File tree

26 files changed

+47
-53
lines changed

26 files changed

+47
-53
lines changed

.lintstagedrc.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export default {
2-
"**/*.(js|jsx|ts|tsx|md|mdx|json|html|css)": ["biome check --apply"],
2+
"**/*.(js|jsx|ts|tsx|md|mdx|json|html|css)": [],
33
};

biome.json

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
},
1616
"correctness": {
1717
"useExhaustiveDependencies": "off"
18+
},
19+
"complexity": {
20+
"noStaticOnlyClass": "off",
21+
"noForEach": "warn"
1822
}
1923
}
2024
},

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
"dev:portal": "pnpm --filter=app-portal dev",
3838
"dev:graphql": "pnpm --filter=graphql dev",
3939
"dev:notification": "pnpm --filter=notification-service dev:notification",
40-
"lint": "biome check --apply .",
40+
"lint": "biome check --apply-unsafe .",
4141
"format": "biome format . --write",
4242
"node:clean": "make -C ./docker clean",
4343
"node:logs": "make -C ./docker logs",

packages/app-explorer/src/systems/Block/actions/get-block.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const schema = z.object({
1414
export const getBlock = act(schema, async (input) => {
1515
const id = input.id;
1616
const isAddressValid = isValidAddress(id);
17-
const isValidBlockHeight = !isNaN(Number(id));
17+
const isValidBlockHeight = !Number.isNaN(Number(id));
1818
if (!isValidBlockHeight && !isValidAddress) {
1919
throw new Error("Invalid block number or block id");
2020
}

packages/app-explorer/src/systems/Core/components/CodeBlock/CodeBlock.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ export function CodeBlock({
4242
}
4343

4444
function getTitle() {
45-
if (title != undefined) return title;
45+
if (title !== undefined) return title;
4646
if (type === "json") return "JSON";
4747
return "Code";
4848
}

packages/app-explorer/src/systems/Core/components/Search/SearchInput.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const SearchResultDropdown = forwardRef<HTMLDivElement, SearchDropdownProps>(
6565
return (
6666
<Dropdown open={openDropdown} onOpenChange={onOpenChange}>
6767
<Dropdown.Trigger>
68-
<Box className="w-full"></Box>
68+
<Box className="w-full" />
6969
</Dropdown.Trigger>
7070
<Dropdown.Content
7171
ref={ref}

packages/app-explorer/src/systems/Core/components/TopNav/TopNav.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export function TopNav() {
6868

6969
return (
7070
<Nav>
71-
<Nav.Desktop className={`px-10 justify-between`}>
71+
<Nav.Desktop className={"px-10 justify-between"}>
7272
<Nav.Menu>
7373
{logo}
7474
{externalLinks}

packages/app-portal/load.envs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ process.env.VITE_APP_VERSION = versions.version;
118118

119119
// Export ETH Fuel contracts addresses
120120
const bridgeSolidityContracts = getBridgeSolidityContracts();
121-
if (bridgeSolidityContracts && bridgeSolidityContracts.FuelMessagePortal) {
121+
if (bridgeSolidityContracts?.FuelMessagePortal) {
122122
process.env.VITE_ETH_FUEL_MESSAGE_PORTAL =
123123
bridgeSolidityContracts.FuelMessagePortal;
124124
process.env.VITE_ETH_FUEL_ERC20_GATEWAY =

packages/app-portal/playwright/e2e/AssetList.test.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ test.describe("Asset List", () => {
2323

2424
await hasText(page, "Select token");
2525
// Check that assets are displayed
26-
let ethAsset, tknAsset;
26+
let ethAsset;
27+
let tknAsset;
2728
ethAsset = getByAriaLabel(page, "ETH symbol");
2829
expect(await ethAsset.innerText()).toBe("ETH");
2930
tknAsset = getByAriaLabel(page, "TKN symbol");
@@ -57,7 +58,8 @@ test.describe("Asset List", () => {
5758

5859
await hasText(page, "Select token");
5960
// Check that assets are displayed
60-
let ethAsset, tknAsset;
61+
let ethAsset;
62+
let tknAsset;
6163
ethAsset = getByAriaLabel(page, "ETH symbol");
6264
expect(await ethAsset.innerText()).toBe("ETH");
6365
tknAsset = getByAriaLabel(page, "TKN symbol");

packages/app-portal/playwright/e2e/Bridge.test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ test.describe("Bridge", () => {
186186
await assetAmountLocator.innerText();
187187

188188
// check if it's settled on the list
189-
const statusLocator = depositLocator.getByText(`Settled`);
189+
const statusLocator = depositLocator.getByText("Settled");
190190
await statusLocator.innerText();
191191

192192
goToBridgePage(page);
@@ -302,7 +302,7 @@ test.describe("Bridge", () => {
302302
await closeTransactionPopup(page);
303303

304304
// check if it's settled on the list
305-
const statusLocator = withdrawTxLocator.getByText(`Settled`);
305+
const statusLocator = withdrawTxLocator.getByText("Settled");
306306
await statusLocator.innerText();
307307
});
308308
});
@@ -469,7 +469,7 @@ test.describe("Bridge", () => {
469469
).toBe(DEPOSIT_AMOUNT);
470470

471471
// check if it's settled on the list
472-
const statusLocator = depositTxLocator.getByText(`Settled`);
472+
const statusLocator = depositTxLocator.getByText("Settled");
473473
await statusLocator.innerText();
474474
});
475475
});
@@ -590,7 +590,7 @@ test.describe("Bridge", () => {
590590
await closeTransactionPopup(page);
591591

592592
// check if it's settled on the list
593-
const statusLocator = withdrawTxLocator.getByText(`Settled`);
593+
const statusLocator = withdrawTxLocator.getByText("Settled");
594594
await statusLocator.innerText();
595595
});
596596
});

packages/app-portal/playwright/e2e/fixtures/utils/waitForExtenssions.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export async function waitForExtensions(
1515
console.log("Checking extensions...");
1616
const pages = await context.pages();
1717
const hasMetamask = pages.find((page) => {
18-
return page.url().includes(extensions["metamask"]?.id);
18+
return page.url().includes(extensions.metamask?.id);
1919
});
2020
const hasFuelWallet = pages.find((page) => {
2121
return page.url().includes(extensions["fuel wallet"]?.id);

packages/app-portal/src/systems/Accounts/components/AccountSwitchDialog/AccountSwitchDialog.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export const AccountSwitchDialog = ({
5050
? { ...styles.listItem, ...styles.select }
5151
: styles.listItem
5252
}
53-
onClick={() => onSelect && onSelect(account)}
53+
onClick={() => onSelect?.(account)}
5454
>
5555
<Box.Flex align="center" gap="$3">
5656
<Avatar.Generated size={"xsm"} hash={account} />

packages/app-portal/src/systems/Bridge/hooks/useBridgeTxs.tsx

+1-2
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,6 @@ export const useBridgeTxs = () => {
5353
: !hasWallet,
5454
shouldShowEmpty:
5555
isConnected && !isLoading && bridgeTxs && bridgeTxs.length === 0,
56-
shouldShowList:
57-
!isLoading && isConnected && ((bridgeTxs && bridgeTxs.length) || 0) > 0,
56+
shouldShowList: !isLoading && isConnected && (bridgeTxs?.length || 0) > 0,
5857
};
5958
};

packages/app-portal/src/systems/Bridge/machines/bridgeTxsMachine.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ export const bridgeTxsMachine = createMachine(
170170
if (!ethTxId || ctx.ethToFuelTxRefs?.[ethTxId])
171171
return ctx.ethToFuelTxRefs;
172172

173-
console.log("NEW: creating machine Fuel To Eth: " + ethTxId);
173+
console.log(`NEW: creating machine Fuel To Eth: ${ethTxId}`);
174174
const newRef = {
175175
[ethTxId]: spawn(
176176
txEthToFuelMachine.withContext({
@@ -196,7 +196,7 @@ export const bridgeTxsMachine = createMachine(
196196
if (!fuelTxId || ctx.fuelToEthTxRefs?.[fuelTxId])
197197
return ctx.fuelToEthTxRefs;
198198

199-
console.log("NEW: creating machine Fuel To Eth: " + fuelTxId);
199+
console.log(`NEW: creating machine Fuel To Eth: ${fuelTxId}`);
200200
const newRef = {
201201
[fuelTxId]: spawn(
202202
txFuelToEthMachine.withContext({

packages/app-portal/src/systems/Chains/eth/services/txEthToFuel.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ export class TxEthToFuelService {
456456
} as any,
457457
fromBlock: "earliest",
458458
});
459-
console.log(`erc20AllLogs`, erc20AllLogs);
459+
console.log("erc20AllLogs", erc20AllLogs);
460460

461461
const erc20Logs = erc20AllLogs.filter((log) => {
462462
const messageSentEvent = decodeEventLog({

packages/app-portal/src/systems/Chains/fuel/utils/getBlock.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ export async function getBlock({
4747
}): Promise<Block> {
4848
const variables = {};
4949
if (height) {
50-
variables["height"] = height;
50+
variables.height = height;
5151
} else {
52-
variables["id"] = blockHash;
52+
variables.id = blockHash;
5353
}
5454
const response = await fetch(providerUrl, {
5555
method: "POST",

packages/app-portal/src/systems/Core/components/Layout.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export const Layout: LayoutComponent = ({ title, children }: LayoutProps) => {
5353
rel="shortcut icon"
5454
type="image/x-icon"
5555
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAABihJREFUWEeNV1uIVVUY/tbae8/UGNhkD5k+mFRGQXZ5MJ2uIpQJ5jgjFRVzUod8KRJMuiCNGdVkwWhhD5YvjkJoIUSpaGER9RQaXUajELoqRuWlnDNzzlrxX9bae59zjEbk3Nb+1/9/3/9/61sGgIf+WWvhnONPxhh4rz+Z4qqwWl/DbwYw3sDn4SSOBIuxQtzwfQzduJAeQkigtGc5m1KiDbmFj7SG/qigxrClaDEYVQPKmh8rh+Un5DEJS1U3r8uXGd2UVhlYQoP+UXDeJ4YT2M3jt8MMzEcKgMig/7KRbGn5cQmSp1FOkr7nAii1wKKRWOnS7ai+cyjypwjIi505BeazlQy9BVBX6AwnL1sqmOX6iXutJmDB62h/A1h9pc9JZRhjO0MCioCWgrS/C26omz9a71GXxmhmVgPmyMiqIp+UqlOsEi/vvTHIKttQ3XEwxlQKuIWRLpsDP7SYoUs8UH92N/zp0djNDd2QJ+aJZw+0JzCDC4GzNbj1H8L88Q+vyV5aiHp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lEfOw7Jaln2kKSIpbGm7ubHJEtHrvYdR6t8B2XQazZwWlERVOkghmUnpD1M+LNY9JyRvrnfgBopGV8MtoVLV2ERuzfDagU4DdI3CD+2DfXwE/oS0nvejDxPI3GVfuIaWAEijKetL9Jmr7juT3BC5ER6ztkZvhXl0k1umbY3BXX9JgNsumVLIvqkBAg2w3nQqKiroC/F2Fn7wGdb38MJkknMHvJv2z4Yd64HwdKZ9g2tdFyMUg5xSUzjU6MUOTiiCIuxIdMC/uh3thL7yTxqVHRTkVgeAHBDaDetiJt6OeJm8jVVMEck3hkGmlhKEZ7biD23AAbuADWDreiwgUrz4yhr3c45Q13wtilnlFwaMR4MQv2feYWLySKBa02fWDcN+fUDoLd86ylQ9XKOWteDltITr/9VX5rC9cdOlgUgQa/ECwBSG78n2ute4FiQxXtIaU1EuUzxFycBbeidsijEqGpHwlP9ftWDfSC2xQwpI2lwS+fNVni164df8LfVAvOcQ3OmIAAAAASUVORK5CYII="
56-
></link>
56+
/>
5757
</Helmet>
5858
<Flex as="main" direction="column" css={styles.root}>
5959
<Header />

packages/app-portal/src/systems/Core/styles/core.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { cssObj } from "@fuel-ui/css";
22

3-
export const SCROLL_WIDTH = `14px`;
3+
export const SCROLL_WIDTH = "14px";
44

55
export const scrollableContent = cssObj({
66
width: `calc(100vw - ${SCROLL_WIDTH})`,

packages/app-portal/src/systems/Ecosystem/components/ProjectItem/ProjectItem.tsx

+11-12
Original file line numberDiff line numberDiff line change
@@ -136,18 +136,17 @@ export const ProjectItem: ProjectItemComponent = ({
136136
wrap="wrap"
137137
css={styles.statusContainer}
138138
>
139-
{status &&
140-
status.map((s, index) => (
141-
<Tag
142-
key={index}
143-
intent="base"
144-
size="xs"
145-
css={styles.tag}
146-
variant="ghost"
147-
>
148-
{s}
149-
</Tag>
150-
))}
139+
{status?.map((s, index) => (
140+
<Tag
141+
key={index}
142+
intent="base"
143+
size="xs"
144+
css={styles.tag}
145+
variant="ghost"
146+
>
147+
{s}
148+
</Tag>
149+
))}
151150
</Box.Flex>
152151
</Box.Stack>
153152
</Card.Body>

packages/graphql/src/domains/Network.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ export class NetworkDomain {
88
static cache = new Cache();
99

1010
static async getChainInfo(url: string) {
11-
let provider = this.cache.get<Provider>(url);
11+
let provider = NetworkDomain.cache.get<Provider>(url);
1212
if (!provider) {
1313
provider = await Provider.create(url);
1414
}
15-
this.cache.put(url, provider, CHAIN_CACHE);
15+
NetworkDomain.cache.put(url, provider, CHAIN_CACHE);
1616
return provider.getChain();
1717
}
1818
}

packages/graphql/src/domains/Operation.ts

-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ function getType(receipt: TxReceipt) {
3232
}
3333

3434
export class OperationDomain {
35-
constructor() {}
36-
3735
async operationsFromTransaction(transaction: Tx) {
3836
const receipts = transaction.receipts || [];
3937
return this._createOperations(receipts);

packages/graphql/src/utils/cache.ts

+1-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,8 @@ export class Cache {
1212
if (data) {
1313
if (Date.now() < data.expire) {
1414
return data.value as T;
15-
} else {
16-
delete this._cache[key];
1715
}
16+
delete this._cache[key];
1817
}
1918
return null;
2019
}

packages/graphql/src/utils/domain.ts

-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export class Domain<S = any, A = any> {
2121
args!: A;
2222
context!: Context;
2323
info!: GraphQLResolveInfo;
24-
constructor() {}
2524

2625
createResolver(key: string, func?: string) {
2726
return {

packages/graphql/src/utils/requireEnv.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export function requireEnv<
77
return keys.reduce(
88
(ret, value) => {
99
const [key, defaultValue] = Array.isArray(value) ? value : [value];
10-
if (!process.env[key] && defaultValue == undefined) {
10+
if (!process.env[key] && defaultValue === undefined) {
1111
throw new Error(`Environment variable ${key} is required`);
1212
}
1313
ret[key] = (process.env[key] ? process.env[key] : defaultValue)!;

packages/notification-service/load.envs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ process.env.APP_VERSION = versions.version;
5555

5656
// Export ETH Fuel contracts addresses
5757
const ethFuelContracts = getEthFuelL1Contracts();
58-
if (ethFuelContracts && ethFuelContracts.FuelMessagePortal) {
58+
if (ethFuelContracts?.FuelMessagePortal) {
5959
process.env.ETH_FUEL_MESSAGE_PORTAL = ethFuelContracts.FuelMessagePortal;
6060
process.env.ETH_FUEL_ERC20_GATEWAY = ethFuelContracts.FuelERC20Gateway;
6161
process.env.ETH_FUEL_CHAIN_STATE = ethFuelContracts.FuelChainState;

packages/ui/scripts/create-defs.mjs

+2-8
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,7 @@ function extractExports(sourceFile) {
5151
ts.isVariableStatement(node) ||
5252
ts.isEnumDeclaration(node)
5353
) {
54-
if (
55-
node.modifiers &&
56-
node.modifiers.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)
57-
) {
54+
if (node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)) {
5855
if (ts.isVariableStatement(node)) {
5956
for (const declaration of node.declarationList.declarations) {
6057
exports.valueExports.push(declaration.name.getText(sourceFile));
@@ -67,10 +64,7 @@ function extractExports(sourceFile) {
6764
ts.isTypeAliasDeclaration(node) ||
6865
ts.isInterfaceDeclaration(node)
6966
) {
70-
if (
71-
node.modifiers &&
72-
node.modifiers.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)
73-
) {
67+
if (node.modifiers?.some((m) => m.kind === ts.SyntaxKind.ExportKeyword)) {
7468
exports.typeExports.push(node.name.text);
7569
}
7670
}

0 commit comments

Comments
 (0)