From ebac299497f71a825e18c932842ff93bfefe574e Mon Sep 17 00:00:00 2001 From: azagatti Date: Tue, 23 Jun 2026 23:15:38 -0300 Subject: [PATCH] chore(lint): use the ultracite CLI instead of calling biome directly Per Ultracite's recommendations, route the scripts and the lefthook hook through the `ultracite` CLI rather than invoking `biome` directly: - lint -> `ultracite check ./src` - format -> `ultracite fix ./src` - pre-commit hook -> `pnpm ultracite fix {staged_files}` (ultracite already passes --no-errors-on-unmatched, so the flag is dropped) Scoped to ./src on purpose: `ultracite check` with no path lints the whole repo (ultracite/biome/core sets includes to ["**"], which merges over ours), which would pull in the examples demo. Restricting via a "**" override in biome.jsonc trips Biome's own noBiomeFirstException rule, so an explicit path is the clean way to keep the prior src-only scope. Also remove the dead jest.config.cjs (the suite runs on Vitest; ts-jest is no longer a dependency and nothing references it). Dropped the redundant lint:fix script (format already runs ultracite fix). Verified: lint, format (idempotent), build, 110 tests, tsc, e2e, and the pre-commit hook all pass. Co-Authored-By: Claude Opus 4.8 (1M context) --- jest.config.cjs | 10 ---------- lefthook.yml | 4 ++-- package.json | 5 ++--- 3 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 jest.config.cjs diff --git a/jest.config.cjs b/jest.config.cjs deleted file mode 100644 index 2d4e17a..0000000 --- a/jest.config.cjs +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - clearMocks: true, - collectCoverage: true, - collectCoverageFrom: ['/src/**/*.ts'], - coverageDirectory: 'coverage', - coverageReporters: ['text-summary', 'lcov'], - preset: 'ts-jest', - testEnvironment: 'node', - testMatch: ['**/*.spec.ts'], -}; diff --git a/lefthook.yml b/lefthook.yml index 1662216..b76fd53 100644 --- a/lefthook.yml +++ b/lefthook.yml @@ -1,7 +1,7 @@ # https://lefthook.dev/configuration/ pre-commit: jobs: - - name: biome + - name: ultracite glob: '**/*.{js,jsx,ts,tsx,json,jsonc}' - run: pnpm biome check --write --no-errors-on-unmatched {staged_files} + run: pnpm ultracite fix {staged_files} stage_fixed: true diff --git a/package.json b/package.json index fa02451..c9d6a68 100644 --- a/package.json +++ b/package.json @@ -22,9 +22,8 @@ ], "scripts": { "build": "tsdown", - "format": "biome format --write ./src", - "lint": "biome check ./src", - "lint:fix": "biome check --write ./src", + "format": "ultracite fix ./src", + "lint": "ultracite check ./src", "test": "vitest", "coverage": "vitest run --coverage", "test:e2e": "pnpm build && cd examples && pnpm install --ignore-workspace && pnpm start",