Skip to content

Commit 4aa13c7

Browse files
committed
Migrate from vite, prettier and eslint to rsbuild and biome
1 parent e7db30d commit 4aa13c7

Some content is hidden

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

41 files changed

+201
-203
lines changed

.eslintrc.js

-5
This file was deleted.

.github/workflows/ci.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,8 @@ jobs:
3939
- name: Build
4040
run: bun run build
4141

42-
- name: Lint code
43-
run: bun lint
44-
4542
- name: Check evmcrispr types
46-
run: bun type-check
43+
run: bun check
4744

4845
- name: Tests
4946
if: steps.changed-files.outputs.any_changed == 'true'

.github/workflows/release.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ jobs:
1212
runs-on: ${{ matrix.os }}
1313
strategy:
1414
matrix:
15-
node-version: [16.x]
15+
node-version: [18.x]
1616
os: [ubuntu-latest]
1717
steps:
18-
- uses: actions/checkout@v3
18+
- uses: actions/checkout@v4
1919
with:
2020
# This makes Actions fetch all Git history so that Changesets can generate changelogs with the correct commits
2121
fetch-depth: 0
2222

2323
- uses: oven-sh/setup-bun@v1
2424

2525
- name: Set up Node ${{ matrix.node-version }}
26-
uses: actions/setup-node@v3
26+
uses: actions/setup-node@v4
2727
with:
2828
cache: "bun"
2929
node-version: ${{ matrix.node-version }}

.pretierrc.json

-1
This file was deleted.

.prettierignore

-4
This file was deleted.

apps/evmcrispr-terminal/.eslintrc.cjs

-5
This file was deleted.

apps/evmcrispr-terminal/.pretierrc.json

-1
This file was deleted.

apps/evmcrispr-terminal/biome.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
3+
"extends": ["@repo/biome-config"]
4+
}

apps/evmcrispr-terminal/package.json

+8-11
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,20 @@
4747
"zustand-x": "^3.0.3"
4848
},
4949
"devDependencies": {
50-
"@repo/eslint-config": "*",
51-
"@repo/prettier-config": "*",
50+
"@repo/biome-config": "*",
5251
"@repo/typescript-config": "*",
52+
"@rsbuild/core": "^0.7.10",
53+
"@rsbuild/plugin-react": "^0.7.10",
5354
"@types/react": "^18.3.3",
5455
"@types/react-dom": "^18.3.0",
5556
"@types/react-transition-group": "^4.4.10",
56-
"@types/use-persisted-state": "^0.3.4",
57-
"@vitejs/plugin-react": "^4.3.1",
58-
"eslint": "^8.57.0",
59-
"vite": "^5.2.1"
57+
"@types/use-persisted-state": "^0.3.4"
6058
},
6159
"scripts": {
62-
"dev": "vite --clearScreen false",
63-
"build": "tsc && vite build",
64-
"type-check": "tsc --noEmit",
65-
"preview": "vite preview",
66-
"lint": "eslint \"src/**/*.{ts,tsx}\""
60+
"dev": "rsbuild --clearScreen false",
61+
"build": "rsbuild build",
62+
"check": "tsc --noEmit && biome check --write",
63+
"preview": "rsbuild preview"
6764
},
6865
"license": "AGPL-3.0-or-later"
6966
}
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { defineConfig } from "@rsbuild/core";
2+
import { pluginReact } from "@rsbuild/plugin-react";
3+
4+
export default defineConfig({
5+
plugins: [pluginReact()],
6+
source: {
7+
entry: {
8+
main: "./src/main.tsx",
9+
},
10+
},
11+
html: {
12+
template: "./index.html",
13+
},
14+
server: {
15+
port: 3000,
16+
headers: {
17+
"Access-Control-Allow-Origin": "*",
18+
"Access-Control-Allow-Methods": "GET",
19+
"Access-Control-Allow-Headers":
20+
"X-Requested-With, content-type, Authorization",
21+
},
22+
},
23+
});

apps/evmcrispr-terminal/src/api/pinata/fetch-pin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const fetchPin = async (
1717
}
1818

1919
return response.json();
20-
} catch (e) {
20+
} catch (_e) {
2121
throw new Error("Bad response from server");
2222
}
2323
};

apps/evmcrispr-terminal/src/api/pinata/pin-json.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const pinJSON = async (data: Record<string, any>): Promise<Res> => {
3737
}
3838

3939
return response.json();
40-
} catch (e) {
40+
} catch (_e) {
4141
throw new Error("Bad response from server");
4242
}
4343
};

apps/evmcrispr-terminal/src/components/ShareButton/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ export default function ShareButton({ script, title }: ShareButtonProps) {
4141
});
4242
setLoading(false);
4343
navigate(`/terminal/${hash}`, { replace: true });
44-
} catch (e) {
44+
} catch (_e) {
4545
toast({
4646
description: "The script could not be saved to IPFS",
4747
status: "error",

apps/evmcrispr-terminal/src/components/TerminalEditor/autocompletion.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ export const runEagerExecutions = async (
255255

256256
return eagerFn;
257257
// eslint-disable-next-line no-empty
258-
} catch (err) {
258+
} catch (_err) {
259259
return;
260260
}
261261
});
@@ -276,7 +276,7 @@ export const runEagerExecutions = async (
276276
try {
277277
resolveLazyBinding(eagerBindingsManager);
278278
// eslint-disable-next-line no-empty
279-
} catch (err) {}
279+
} catch (_err) {}
280280
});
281281
};
282282

apps/evmcrispr-terminal/tsconfig.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": "@repo/typescript-config/vite.json",
2+
"extends": "@repo/typescript-config/rsbuild.json",
33
"include": ["src"],
44
"compilerOptions": {
55
"jsx": "react-jsx"

apps/evmcrispr-terminal/vite.config.ts

-26
This file was deleted.

biome.json

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
3+
"extends": ["@repo/biome-config"]
4+
}

bun.lockb

-59.3 KB
Binary file not shown.

lint-staged.config.js

+2-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
module.exports = {
22
// Type check TypeScript files
3-
"(apps|packages)/**/*.(ts|tsx)": () => "bun run type-check",
3+
"(apps|packages)/**/*.(ts|tsx)": () => "bun run check",
44

55
// Lint then format TypeScript and JavaScript files
6-
"(apps|packages)/**/*.(ts|tsx|js)": (filenames) => [
7-
`bunx eslint --fix ${filenames.join(" ")}`,
8-
`bunx prettier --write ${filenames.join(" ")}`,
9-
],
6+
"(apps|packages)/**/*.(ts|tsx|js)": "bun run format --staged",
107
};

package.json

+5-10
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,25 @@
11
{
22
"private": true,
33
"scripts": {
4-
"prepare": "husky install",
4+
"prepare": "husky",
55
"build": "turbo build",
66
"changeset:release": "bun run build && changeset publish",
77
"changeset:version": "changeset version && bun install --lockfile-only",
88
"dev": "turbo dev",
9-
"type-check": "turbo run type-check",
10-
"lint": "turbo lint",
9+
"check": "turbo run check",
1110
"test": "turbo test",
1211
"test:coverage": "turbo run test:coverage",
13-
"format": "prettier --write \"**/*.{ts,tsx,md}\"",
12+
"format": "biome format --write",
1413
"dev:terminal": "turbo run dev --filter=evmcrispr-terminal"
1514
},
1615
"devDependencies": {
1716
"@changesets/cli": "^2.27.6",
18-
"eslint": "^8.57.0",
17+
"@repo/biome-config": "*",
1918
"husky": "^9.0.11",
2019
"lint-staged": "^15.2.7",
21-
"prettier": "^3.2.5",
2220
"turbo": "^2.0.5"
2321
},
2422
"name": "evmcrispr-monorepo",
2523
"packageManager": "[email protected]",
26-
"workspaces": [
27-
"apps/*",
28-
"packages/*"
29-
]
24+
"workspaces": ["apps/*", "packages/*"]
3025
}

packages/config-biome/biome.json

+111
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
3+
"organizeImports": {
4+
"enabled": false
5+
},
6+
"vcs": {
7+
"enabled": true,
8+
"clientKind": "git",
9+
"useIgnoreFile": true
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"formatWithErrors": false,
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineEnding": "lf",
17+
"lineWidth": 80,
18+
"attributePosition": "auto"
19+
},
20+
"linter": {
21+
"enabled": true,
22+
"rules": {
23+
"recommended": false,
24+
"complexity": {
25+
"noBannedTypes": "error",
26+
"noExtraBooleanCast": "error",
27+
"noMultipleSpacesInRegularExpressionLiterals": "error",
28+
"noUselessCatch": "error",
29+
"noUselessTypeConstraint": "error",
30+
"noWith": "error"
31+
},
32+
"correctness": {
33+
"noConstAssign": "error",
34+
"noConstantCondition": "error",
35+
"noEmptyCharacterClassInRegex": "error",
36+
"noEmptyPattern": "error",
37+
"noGlobalObjectCalls": "error",
38+
"noInnerDeclarations": "error",
39+
"noInvalidConstructorSuper": "error",
40+
"noNewSymbol": "error",
41+
"noNonoctalDecimalEscape": "error",
42+
"noPrecisionLoss": "error",
43+
"noSelfAssign": "error",
44+
"noSetterReturn": "error",
45+
"noSwitchDeclarations": "error",
46+
"noUndeclaredVariables": "error",
47+
"noUnreachable": "error",
48+
"noUnreachableSuper": "error",
49+
"noUnsafeFinally": "error",
50+
"noUnsafeOptionalChaining": "error",
51+
"noUnusedLabels": "error",
52+
"noUnusedVariables": "error",
53+
"useArrayLiterals": "off",
54+
"useIsNan": "error",
55+
"useValidForDirection": "error",
56+
"useYield": "error"
57+
},
58+
"style": {
59+
"noNamespace": "error",
60+
"noNonNullAssertion": "off",
61+
"useAsConstAssertion": "error",
62+
"useBlockStatements": "off"
63+
},
64+
"suspicious": {
65+
"noAsyncPromiseExecutor": "error",
66+
"noCatchAssign": "error",
67+
"noClassAssign": "error",
68+
"noCompareNegZero": "error",
69+
"noControlCharactersInRegex": "error",
70+
"noDebugger": "error",
71+
"noDuplicateCase": "error",
72+
"noDuplicateClassMembers": "error",
73+
"noDuplicateObjectKeys": "error",
74+
"noDuplicateParameters": "error",
75+
"noEmptyBlockStatements": "off",
76+
"noExplicitAny": "off",
77+
"noExtraNonNullAssertion": "error",
78+
"noFallthroughSwitchClause": "error",
79+
"noFunctionAssign": "error",
80+
"noGlobalAssign": "error",
81+
"noImportAssign": "error",
82+
"noMisleadingCharacterClass": "error",
83+
"noMisleadingInstantiator": "error",
84+
"noPrototypeBuiltins": "error",
85+
"noRedeclare": "error",
86+
"noShadowRestrictedNames": "error",
87+
"noUnsafeDeclarationMerging": "error",
88+
"noUnsafeNegation": "error",
89+
"useGetterReturn": "error",
90+
"useValidTypeof": "error"
91+
}
92+
}
93+
},
94+
"overrides": [
95+
{
96+
"include": ["*.ts", "*.tsx", "*.mts", "*.cts"],
97+
"linter": {
98+
"rules": {
99+
"correctness": {
100+
"noUndeclaredVariables": "off"
101+
},
102+
"style": {
103+
"noArguments": "error",
104+
"noVar": "error",
105+
"useConst": "error"
106+
}
107+
}
108+
}
109+
}
110+
]
111+
}

packages/config-biome/package.json

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "@repo/biome-config",
3+
"version": "0.0.0",
4+
"main": "biome.json",
5+
"license": "MIT",
6+
"dependencies": {
7+
"@biomejs/biome": "^1.8.1"
8+
},
9+
"publishConfig": {
10+
"access": "public"
11+
}
12+
}

0 commit comments

Comments
 (0)