Skip to content

Commit c71678f

Browse files
authored
chore(frontend): replace ESLint and Prettier with Biome (#1066)
* chore(frontend): replace ESLint and Prettier with Biome biome check covers formatting, lint and import order, so the separate format step goes. Biome has no typescript dependency. * chore(frontend): use biome-config 1.0.0-rc.2 rc.2 no longer reports extra effect dependencies, so the two suppressions go. * chore(frontend): use biome-config 1.0.0
1 parent b8e4f76 commit c71678f

44 files changed

Lines changed: 218 additions & 1641 deletions

Some content is hidden

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

‎.githooks/pre-commit‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ STAGED=$(git diff --cached --name-only --diff-filter=ACM)
77
if echo "$STAGED" | grep -q "^frontend/"; then
88
echo "Running frontend lint..."
99
(cd "$ROOT/frontend" && yarn lint)
10-
(cd "$ROOT/frontend" && yarn format)
1110
fi
1211

1312
if echo "$STAGED" | grep -q "^backend/"; then

‎.github/dependabot.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ updates:
99
semver-major-days: 14
1010
semver-minor-days: 7
1111
semver-patch-days: 5
12-
ignore:
13-
- dependency-name: "eslint"
14-
update-types: ["version-update:semver-major"]
1512
groups:
1613
react:
1714
patterns:

‎.github/workflows/ci.yaml‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ jobs:
2727
yarn() { node .yarn/releases/yarn-*.cjs "$@"; }
2828
yarn install --immutable
2929
yarn playwright install chromium
30-
yarn format
3130
yarn lint
3231
yarn typecheck
3332
yarn test

‎.vscode/extensions.json‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
{
2-
"recommendations": [
3-
"dbaeumer.vscode-eslint",
4-
"esbenp.prettier-vscode"
5-
]
2+
"recommendations": ["biomejs.biome"]
63
}

‎.vscode/settings.json‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{
2-
"eslint.useFlatConfig": true
2+
"[javascript][javascriptreact][typescript][typescriptreact][json][css]": {
3+
"editor.defaultFormatter": "biomejs.biome"
4+
},
5+
"editor.codeActionsOnSave": {
6+
"source.fixAll.biome": "explicit",
7+
"source.organizeImports.biome": "explicit"
8+
}
39
}

‎frontend/CLAUDE.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
## Validation
44

5-
Run `yarn validate` after changes — runs lint, format check, and typecheck in one shot.
5+
Run `yarn validate` after changes — runs typecheck and lint in one shot.
66

77
Individual scripts:
88

9-
- `yarn lint` / `yarn lint:fix`
10-
- `yarn format` / `yarn format:fix`
9+
- `yarn lint` / `yarn lint:fix` — Biome (`@anarkisti/biome-config/react`):
10+
formatting, lint and import order in one pass
1111
- `yarn typecheck`
1212

1313
Use yarn (not npm). It's vendored at `.yarn/releases/` and pinned by `yarnPath`

‎frontend/biome.json‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"extends": ["@anarkisti/biome-config/react"]
4+
}

‎frontend/eslint.config.js‎

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

‎frontend/package.json‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc && vite build",
9-
"lint": "eslint eslint.config.js src",
10-
"lint:fix": "eslint eslint.config.js src --fix",
11-
"format": "prettier --check src",
12-
"format:fix": "prettier --write src",
9+
"lint": "biome check src",
10+
"lint:fix": "biome check --write src",
1311
"typecheck": "tsc --noEmit",
14-
"validate": "yarn typecheck && yarn lint && yarn format",
12+
"validate": "yarn typecheck && yarn lint",
1513
"preview": "vite preview",
1614
"test": "vitest",
1715
"test:e2e": "playwright test -c ./playwright.configuration.ts"
@@ -34,18 +32,16 @@
3432
"usehooks-ts": "^3.1.1"
3533
},
3634
"devDependencies": {
37-
"@anarkisti/eslint-config": "^1.1.0",
35+
"@anarkisti/biome-config": "^1.0.0",
36+
"@biomejs/biome": "^2.5.15",
3837
"@types/leaflet": "^1.9.22",
3938
"@types/react": "^19.3.0",
4039
"@types/react-dom": "^19.3.0",
4140
"@vitejs/plugin-react": "^6.1.1",
4241
"@vitest/browser-playwright": "^5.0.3",
4342
"babel-plugin-react-compiler": "^1.0.0",
44-
"eslint": "^10.11.0",
4543
"playwright": "^1.63.0",
46-
"prettier": "^3.9.9",
4744
"typescript": "^6.0.3",
48-
"typescript-eslint": "^8.70.1",
4945
"unplugin-auto-import": "^21.1.0",
5046
"vite": "^8.3.1",
5147
"vite-plugin-qrcode": "^0.4.1",

‎frontend/src/App.tsx‎

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,7 @@ import SolisBox from "./components/SolisBox";
1818
import TemperatureBox from "./components/TemperatureBox";
1919
import Wordmark from "./components/Wordmark";
2020
import { mq } from "./mq";
21-
import {
22-
type HueLiveEvent,
23-
type MotionMember,
24-
type MotionUnit,
25-
type Response,
26-
type Sensor,
27-
} from "./types/hue";
21+
import type { HueLiveEvent, MotionMember, MotionUnit, Response, Sensor } from "./types/hue";
2822

2923
// Leaflet is heavy; only pull it in when the radar tab is opened.
3024
const RainMap = lazy(() => import("./components/RainMap"));

0 commit comments

Comments
 (0)