Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions .github/workflows/update-biome-schema.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Update Biome Schema

on:
pull_request:
paths:
- 'package.json'
- 'pnpm-lock.yaml'

permissions:
contents: write
pull-requests: write

jobs:
update-schema:
name: Update Biome Schema
runs-on: ubuntu-latest
if: github.event.pull_request.user.login == 'dependabot[bot]'

steps:
- name: Checkout code
uses: actions/checkout@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
ref: ${{ github.head_ref }}

- name: Setup pnpm
uses: pnpm/action-setup@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "24"
cache: 'pnpm'

- name: Install dependencies
run: pnpm install

- name: Get Biome version
id: biome-version
run: |
BIOME_VERSION=$(pnpm list @biomejs/biome --json | jq -r '.[0].devDependencies."@biomejs/biome".version')
echo "version=${BIOME_VERSION}" >> $GITHUB_OUTPUT

- name: Update biome.json schema
run: |
BIOME_VERSION="${{ steps.biome-version.outputs.version }}"
MAJOR_MINOR=$(echo $BIOME_VERSION | cut -d. -f1,2)
jq --arg schema "https://biomejs.dev/schemas/${MAJOR_MINOR}/schema.json" '."$schema" = $schema' biome.json > biome.json.tmp
mv biome.json.tmp biome.json

- name: Check for changes
id: check-changes
run: |
if git diff --quiet; then
echo "changed=false" >> $GITHUB_OUTPUT
else
echo "changed=true" >> $GITHUB_OUTPUT
fi

- name: Commit changes
if: steps.check-changes.outputs.changed == 'true'
run: |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add biome.json pnpm-lock.yaml
git commit -m "chore: update biome.json schema to match installed version"
git push
88 changes: 44 additions & 44 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,46 +1,46 @@
{
"$schema": "https://biomejs.dev/schemas/2.1.0/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noParameterAssign": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
"$schema": "https://biomejs.dev/schemas/2.2/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "tab"
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"style": {
"noParameterAssign": "error",
"useAsConstAssertion": "error",
"useDefaultParameterLast": "error",
"useEnumInitializers": "error",
"useSelfClosingElements": "error",
"useSingleVarDeclarator": "error",
"noUnusedTemplateLiteral": "error",
"useNumberNamespace": "error",
"noInferrableTypes": "error",
"noUselessElse": "error"
}
}
},
"javascript": {
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"packageManager": "pnpm@10.12.1",
"devDependencies": {
"@biomejs/biome": "~2.1.4"
"@biomejs/biome": "~2.2.0"
},
"scripts": {
"biome": "biome",
Expand Down
76 changes: 38 additions & 38 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.