Skip to content

Commit f482990

Browse files
committed
chore: add biome on project
1 parent 5c3269d commit f482990

File tree

656 files changed

+24095
-24130
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

656 files changed

+24095
-24130
lines changed

.eslintignore

-31
This file was deleted.

.eslintrc.js

-61
This file was deleted.

.github/workflows/pr.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: 'PR Checks'
1+
name: "PR Checks"
22

33
on:
44
pull_request:
@@ -48,5 +48,5 @@ jobs:
4848
- name: Run lint & ts:check
4949
run: |
5050
pnpm build
51-
pnpm lint:check
51+
pnpm lint
5252
pnpm ts:check

.lintstagedrc.mjs

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

.npmrc

-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,5 @@ save-workspace-protocol=rolling
2727
public-hoist-pattern[]=*tailwind-variants*
2828
public-hoist-pattern[]=*framer-motion*
2929
public-hoist-pattern[]=*@react-aria/interactions*
30-
public-hoist-pattern[]=*eslint*
31-
public-hoist-pattern[]=*prettier*
3230
public-hoist-pattern[]=*ts-node*
3331
public-hoist-pattern[]=@types*

.prettierignore

-25
This file was deleted.

.prettierrc.js

-17
This file was deleted.

.vscode/extensions.json

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
2-
"recommendations": [
3-
"esbenp.prettier-vscode",
4-
"dbaeumer.vscode-eslint",
5-
"statelyai.stately-vscode",
6-
"firsttris.vscode-jest-runner",
7-
"rust-lang.rust-analyzer",
8-
"bradlc.vscode-tailwindcss"
9-
]
2+
"recommendations": [
3+
"statelyai.stately-vscode",
4+
"firsttris.vscode-jest-runner",
5+
"rust-lang.rust-analyzer",
6+
"bradlc.vscode-tailwindcss"
7+
]
108
}

.vscode/settings.json

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
{
2-
"editor.defaultFormatter": "esbenp.prettier-vscode",
3-
"editor.formatOnSave": true,
4-
"editor.codeActionsOnSave": {
5-
"source.fixAll.eslint": "explicit"
6-
},
7-
"editor.quickSuggestions": {
8-
"strings": "on"
9-
},
10-
"tailwindCSS.experimental.classRegex": [
11-
["tv\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
12-
]
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"editor.formatOnSave": true,
4+
"editor.codeActionsOnSave": {
5+
"source.fixAll.eslint": "explicit"
6+
},
7+
"editor.quickSuggestions": {
8+
"strings": "on"
9+
},
10+
"tailwindCSS.experimental.classRegex": [
11+
["tv\\(([^)]*)\\)", "[\"'`]([^\"'`]*).*?[\"'`]"]
12+
]
1313
}

biome.json

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.5.3/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"linter": {
7+
"enabled": true,
8+
"rules": {
9+
"recommended": true,
10+
"style": {
11+
"noNonNullAssertion": "off"
12+
},
13+
"suspicious": {
14+
"noExplicitAny": "warn"
15+
},
16+
"correctness": {
17+
"useExhaustiveDependencies": "off"
18+
}
19+
}
20+
},
21+
"vcs": {
22+
"enabled": true,
23+
"clientKind": "git",
24+
"useIgnoreFile": true
25+
},
26+
"files": {
27+
"ignore": [
28+
"**/node_modules",
29+
"**/.turbo",
30+
"**/.next",
31+
"**/.vercel",
32+
"**/dist",
33+
"**/build",
34+
"**/fuel-v2-contracts",
35+
"**/coverage",
36+
"**/generated",
37+
"**/storybook-static",
38+
"*.typegen.ts",
39+
"./packages/app-explorer/public/storybook",
40+
"./packages/app-explorer/public/ui",
41+
"./packages/app-explorer/public/portal",
42+
"./packages/app-explorer/public/portal-storybook",
43+
"./packages/app-portal/public/**",
44+
"./packages/app-portal/src/types",
45+
"pnpm-lock.yaml"
46+
]
47+
}
48+
}
+47-45
Original file line numberDiff line numberDiff line change
@@ -1,56 +1,58 @@
1-
import { BaseAssetId, Predicate, Provider, Wallet, bn, hexlify } from 'fuels';
2-
import { promises as fs } from 'node:fs';
3-
import { resolve } from 'node:path';
1+
import { promises as fs } from "node:fs";
2+
import { resolve } from "node:path";
3+
import { BaseAssetId, Predicate, Provider, Wallet, bn, hexlify } from "fuels";
44

55
const { FUEL_PROVIDER, PRIVATE_KEY } = process.env;
6-
const BIN_PATH = resolve(__dirname, '../out/debug/predicate-app.bin');
6+
const BIN_PATH = resolve(__dirname, "../out/debug/predicate-app.bin");
77
const AMOUNT = 300_000;
88

99
if (!FUEL_PROVIDER || !PRIVATE_KEY) {
10-
throw new Error('Missing some config in .env file. Should have FUEL_PROVIDER and PRIVATE_KEY');
10+
throw new Error(
11+
"Missing some config in .env file. Should have FUEL_PROVIDER and PRIVATE_KEY",
12+
);
1113
}
1214

1315
async function main() {
14-
const binHex = hexlify(await fs.readFile(BIN_PATH));
15-
const provider = await Provider.create(FUEL_PROVIDER!);
16-
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY!, provider);
17-
const { minGasPrice: gasPrice } = wallet.provider.getGasConfig();
18-
const walletAddress = wallet.address.toB256();
19-
const abiPath = resolve(__dirname, '../out/debug/predicate-app-abi.json');
20-
const abi = await fs.readFile(abiPath, 'utf-8');
21-
const abiJson = JSON.parse(abi);
22-
const predicate = new Predicate(binHex, provider, abiJson);
23-
24-
console.log('💰 Funding predicate...');
25-
const tx1 = await wallet.transfer(predicate.address, AMOUNT, BaseAssetId, {
26-
gasPrice,
27-
});
28-
29-
const res1 = await tx1.waitForResult();
30-
const predicateBalance = bn(await predicate.getBalance());
31-
console.log(`→ Transaction Id: ${res1.id}`);
32-
console.log(`→ Predicate balance: ${predicateBalance.format()}`);
33-
console.log(`→ Predicate Id: ${predicate.address.toB256()}`);
34-
console.log(`📝 Wallet address: ${walletAddress}\n`);
35-
36-
console.log('⌛️ Running predicate...');
37-
predicate.setData(walletAddress);
38-
39-
try {
40-
const tx2 = await predicate.transfer(
41-
wallet.address,
42-
AMOUNT - 150_000,
43-
BaseAssetId,
44-
{
45-
gasPrice,
46-
}
47-
);
48-
const res2 = await tx2.waitForResult();
49-
console.log(`→ Transaction Id: ${res2.id}`);
50-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
51-
} catch (error: any) {
52-
console.error(error?.response?.errors?.[0].message);
53-
}
16+
const binHex = hexlify(await fs.readFile(BIN_PATH));
17+
const provider = await Provider.create(FUEL_PROVIDER!);
18+
const wallet = Wallet.fromPrivateKey(PRIVATE_KEY!, provider);
19+
const { minGasPrice: gasPrice } = wallet.provider.getGasConfig();
20+
const walletAddress = wallet.address.toB256();
21+
const abiPath = resolve(__dirname, "../out/debug/predicate-app-abi.json");
22+
const abi = await fs.readFile(abiPath, "utf-8");
23+
const abiJson = JSON.parse(abi);
24+
const predicate = new Predicate(binHex, provider, abiJson);
25+
26+
console.log("💰 Funding predicate...");
27+
const tx1 = await wallet.transfer(predicate.address, AMOUNT, BaseAssetId, {
28+
gasPrice,
29+
});
30+
31+
const res1 = await tx1.waitForResult();
32+
const predicateBalance = bn(await predicate.getBalance());
33+
console.log(`→ Transaction Id: ${res1.id}`);
34+
console.log(`→ Predicate balance: ${predicateBalance.format()}`);
35+
console.log(`→ Predicate Id: ${predicate.address.toB256()}`);
36+
console.log(`📝 Wallet address: ${walletAddress}\n`);
37+
38+
console.log("⌛️ Running predicate...");
39+
predicate.setData(walletAddress);
40+
41+
try {
42+
const tx2 = await predicate.transfer(
43+
wallet.address,
44+
AMOUNT - 150_000,
45+
BaseAssetId,
46+
{
47+
gasPrice,
48+
},
49+
);
50+
const res2 = await tx2.waitForResult();
51+
console.log(`→ Transaction Id: ${res2.id}`);
52+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
53+
} catch (error: any) {
54+
console.error(error?.response?.errors?.[0].message);
55+
}
5456
}
5557

5658
main();

contracts/predicate/vitest.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from 'vitest/config';
1+
import { defineConfig } from "vitest/config";
22

33
export default defineConfig({
4-
test: {
5-
include: ['./tests/**.ts'],
6-
},
4+
test: {
5+
include: ["./tests/**.ts"],
6+
},
77
});

0 commit comments

Comments
 (0)