Skip to content

Commit 67847a2

Browse files
authored
Replace ESLint and Prettier with Biome (#186)
1 parent 78ea1f4 commit 67847a2

File tree

16 files changed

+186
-1757
lines changed

16 files changed

+186
-1757
lines changed

.eslintignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

.eslintrc.json

Lines changed: 0 additions & 17 deletions
This file was deleted.

.github/workflows/ci.yml

Lines changed: 6 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -21,29 +21,11 @@ jobs:
2121
- name: Checkout
2222
uses: actions/checkout@v4
2323

24-
- name: Cache Yarn cache
25-
uses: actions/cache@v4
26-
env:
27-
cache-name: yarn-cache
28-
with:
29-
path: ~/.yarn/berry/cache
30-
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
31-
restore-keys: |
32-
${{ runner.os }}-${{ env.cache-name }}
33-
34-
- name: Use Node.js
35-
uses: actions/setup-node@v4
36-
with:
37-
node-version: '20'
38-
39-
- name: Enable Corepack
40-
run: corepack enable
41-
42-
- name: Install dependencies
43-
run: yarn --immutable
24+
- name: Setup Biome
25+
uses: biomejs/setup-biome@v2
4426

4527
- name: Run tests
46-
run: yarn lint
28+
run: biome lint
4729

4830
typescript:
4931
name: Type checking
@@ -85,26 +67,8 @@ jobs:
8567
- name: Checkout
8668
uses: actions/checkout@v4
8769

88-
- name: Cache Yarn cache
89-
uses: actions/cache@v4
90-
env:
91-
cache-name: yarn-cache
92-
with:
93-
path: ~/.yarn/berry/cache
94-
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
95-
restore-keys: |
96-
${{ runner.os }}-${{ env.cache-name }}
97-
98-
- name: Use Node.js
99-
uses: actions/setup-node@v4
100-
with:
101-
node-version: '20'
102-
103-
- name: Enable Corepack
104-
run: corepack enable
105-
106-
- name: Install dependencies
107-
run: yarn --immutable
70+
- name: Setup Biome
71+
uses: biomejs/setup-biome@v2
10872

10973
- name: Run formatting
110-
run: yarn format
74+
run: biome format

.husky/pre-commit

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
yarn lint-staged
1+
yarn format --staged --no-errors-on-unmatched --write

.lintstagedrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

.prettierignore

Lines changed: 0 additions & 5 deletions
This file was deleted.

.prettierrc.json

Lines changed: 0 additions & 5 deletions
This file was deleted.

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
2-
"recommendations": ["dbaeumer.vscode-eslint", "eamodio.gitlens", "esbenp.prettier-vscode"],
2+
"recommendations": ["biomejs.biome", "eamodio.gitlens"],
33
"unwantedRecommendations": ["dbaeumer.jshint"]
44
}

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"editor.defaultFormatter": "esbenp.prettier-vscode",
2+
"editor.defaultFormatter": "biomejs.biome",
33
"editor.formatOnSave": true,
44
"search.exclude": {
55
"**/.yarn": true

biome.json

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
3+
"files": {
4+
"ignore": [".tsimp", "coverage", "dist", ".pnp.cjs", ".pnp.loader.mjs"]
5+
},
6+
"formatter": {
7+
"lineWidth": 100,
8+
"indentStyle": "space"
9+
},
10+
"linter": {
11+
"rules": {
12+
"complexity": {
13+
"noUselessSwitchCase": "off"
14+
},
15+
"suspicious": {
16+
"noConsoleLog": "warn"
17+
}
18+
}
19+
},
20+
"javascript": {
21+
"formatter": {
22+
"quoteStyle": "single"
23+
}
24+
},
25+
"overrides": [
26+
{
27+
"include": ["**/package.json"],
28+
"formatter": {
29+
"lineWidth": 1
30+
}
31+
},
32+
{
33+
"include": ["**/vite.config.ts"],
34+
"linter": {
35+
"rules": {
36+
"suspicious": {
37+
"noConsoleLog": "off"
38+
}
39+
}
40+
}
41+
}
42+
]
43+
}

0 commit comments

Comments
 (0)