Skip to content

Commit 4218528

Browse files
committed
fix: resolve all biome lint/format violations
- fix(cas-frontend): format next.config.mjs and next-env.d.ts - chore(biome): exclude next-env.d.ts from lint scope (auto-generated by Next.js) - chore(biome): bump schema version to 2.4.4 in packages/core and packages/services - feat(cas-frontend): add vercel.json with pnpm monorepo build config
1 parent 881fe45 commit 4218528

File tree

7 files changed

+40
-13
lines changed

7 files changed

+40
-13
lines changed

apps/cas/frontend/next-env.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
import './.next/types/routes.d.ts';
4+
5+
// NOTE: This file should not be edited
6+
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

apps/cas/frontend/next.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ const nextConfig = {
66
// Production: https://api.cas.cfxdevkit.org
77
// Development: http://localhost:3001
88
env: {
9-
NEXT_PUBLIC_API_URL: process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:3001',
9+
NEXT_PUBLIC_API_URL:
10+
process.env.NEXT_PUBLIC_API_URL ?? 'http://localhost:3001',
1011
},
1112
};
1213

apps/cas/frontend/vercel.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://openapi.vercel.sh/vercel.json",
3+
"framework": "nextjs",
4+
5+
"installCommand": "cd ../../.. && pnpm install --frozen-lockfile",
6+
"buildCommand": "cd ../../.. && pnpm turbo build --filter=@cfxdevkit/cas-frontend",
7+
"outputDirectory": ".next",
8+
9+
"headers": [
10+
{
11+
"source": "/(.*)",
12+
"headers": [
13+
{ "key": "X-Content-Type-Options", "value": "nosniff" },
14+
{ "key": "X-Frame-Options", "value": "DENY" },
15+
{ "key": "Referrer-Policy", "value": "strict-origin-when-cross-origin" }
16+
]
17+
}
18+
]
19+
}

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
"!pnpm-lock.yaml",
2020
"!**/generated.ts",
2121
"!conflux-contracts",
22-
"!**/globals.css"
22+
"!**/globals.css",
23+
"!**/next-env.d.ts"
2324
]
2425
},
2526
"formatter": {

packages/contracts/src/standard-abis.test.ts

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ describe('erc2612Abi', () => {
6666
(e) => e.type === 'function' && e.name === 'permit'
6767
) as { inputs: { type: string }[] } | undefined;
6868
expect(permit).toBeDefined();
69-
const types = permit!.inputs.map((i) => i.type);
69+
const types = permit?.inputs.map((i) => i.type);
7070
expect(types).toEqual([
7171
'address',
7272
'address',
@@ -113,11 +113,11 @@ describe('erc20Abi', () => {
113113
(e) => e.type === 'event' && e.name === 'Transfer'
114114
) as { inputs: { name: string; indexed: boolean }[] } | undefined;
115115
expect(ev).toBeDefined();
116-
const names = ev!.inputs.map((i) => i.name);
116+
const names = ev?.inputs.map((i) => i.name);
117117
expect(names).toEqual(['from', 'to', 'value']);
118-
expect(ev!.inputs[0].indexed).toBe(true);
119-
expect(ev!.inputs[1].indexed).toBe(true);
120-
expect(ev!.inputs[2].indexed).toBe(false);
118+
expect(ev?.inputs[0].indexed).toBe(true);
119+
expect(ev?.inputs[1].indexed).toBe(true);
120+
expect(ev?.inputs[2].indexed).toBe(false);
121121
});
122122
});
123123

@@ -219,8 +219,8 @@ describe('erc721Abi', () => {
219219
(e) => e.type === 'event' && e.name === 'Transfer'
220220
) as { inputs: { name: string; indexed: boolean }[] } | undefined;
221221
expect(ev).toBeDefined();
222-
expect(ev!.inputs[2].name).toBe('tokenId');
223-
expect(ev!.inputs[2].indexed).toBe(true);
222+
expect(ev?.inputs[2].name).toBe('tokenId');
223+
expect(ev?.inputs[2].indexed).toBe(true);
224224
});
225225
});
226226

@@ -295,7 +295,7 @@ describe('erc1155Abi', () => {
295295
(e) => e.type === 'event' && e.name === 'TransferSingle'
296296
) as { inputs: { name: string }[] } | undefined;
297297
expect(ev).toBeDefined();
298-
expect(ev!.inputs.map((i) => i.name)).toEqual([
298+
expect(ev?.inputs.map((i) => i.name)).toEqual([
299299
'operator',
300300
'from',
301301
'to',
@@ -369,7 +369,7 @@ describe('erc4626Abi', () => {
369369
(e) => e.type === 'event' && e.name === 'Withdraw'
370370
) as { inputs: { name: string }[] } | undefined;
371371
expect(ev).toBeDefined();
372-
expect(ev!.inputs.map((i) => i.name)).toEqual([
372+
expect(ev?.inputs.map((i) => i.name)).toEqual([
373373
'sender',
374374
'receiver',
375375
'owner',

packages/core/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.4.2/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
33
"root": false,
44
"extends": "//",
55
"files": {

packages/services/biome.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.4.2/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.4/schema.json",
33
"root": false,
44
"extends": "//",
55
"files": {

0 commit comments

Comments
 (0)