From cd4e602cce71fd5a97bdea0d6e3c5f21620d0eae Mon Sep 17 00:00:00 2001 From: FaizFarooqMoazam Date: Tue, 9 Dec 2025 19:00:14 +0300 Subject: [PATCH] Added Biome linter config and CI: created biome.json, workflow file and updated root package.json file. --- .github/workflows/biome.yml | 28 ++++++++++++++++++++++++++++ biome.json | 34 ++++++++++++++++++++++++++++++++++ package.json | 11 ++++++++++- 3 files changed, 72 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/biome.yml create mode 100644 biome.json diff --git a/.github/workflows/biome.yml b/.github/workflows/biome.yml new file mode 100644 index 00000000..8619977a --- /dev/null +++ b/.github/workflows/biome.yml @@ -0,0 +1,28 @@ +name: Biome + +on: + pull_request: + branches: + - '**' + push: + branches: + - main + +jobs: + biome: + name: Biome Check + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup Bun + uses: oven-sh/setup-bun@v2 + with: + bun-version: 1.2.3 + + - name: Install dependencies + run: bun install + + - name: Run Biome (CI reporter) + run: bun run biome:ci diff --git a/biome.json b/biome.json new file mode 100644 index 00000000..ba744128 --- /dev/null +++ b/biome.json @@ -0,0 +1,34 @@ +{ + "$schema": "https://biomejs.dev/schemas/2.3.8/schema.json", + "vcs": { + "enabled": true, + "clientKind": "git", + "useIgnoreFile": true + }, + "files": { + "ignoreUnknown": false + }, + "formatter": { + "enabled": true, + "indentStyle": "tab" + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "javascript": { + "formatter": { + "quoteStyle": "double" + } + }, + "assist": { + "enabled": true, + "actions": { + "source": { + "organizeImports": "on" + } + } + } +} diff --git a/package.json b/package.json index ed61cf6f..b3510fa7 100644 --- a/package.json +++ b/package.json @@ -6,7 +6,16 @@ "dev": "nx run-many -c development -t dev --parallel", "build": "nx run-many -t build --parallel", "start": "nx run-many -t start --parallel", - "format": "prettier --write . --ignore-path .gitignore" + "format": "prettier --write . --ignore-path .gitignore", + "biome:check": "biome check .", + "biome:fix": "biome check --write .", + "biome:format": "biome format --write .", + "biome:fix:unsafe": "biome check --write --unsafe .", + "biome:staged": "git diff --name-only --cached --diff-filter=ACMRTUXB | xargs -r -d '\n' biome check --write --max-diagnostics=1000", + "biome:since": "biome check --since origin/main .", + "biome:ci": "biome check --reporter=github --max-diagnostics=1000 .", + "biome:check:frontend": "biome check apps/frontend", + "biome:check:backend": "biome check apps/backend" }, "devDependencies": { "@nx/next": "19.6.3",