diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml new file mode 100644 index 00000000..ec8efd55 --- /dev/null +++ b/.github/workflows/format.yml @@ -0,0 +1,48 @@ +name: Code Formatting + +on: + pull_request: + branches: [ main, master ] + workflow_dispatch: + +jobs: + format: + runs-on: ubuntu-latest + + permissions: + contents: write + pull-requests: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Install Biome + run: npm install --global @biomejs/biome + + - name: Format with Biome + run: biome format --write . + + - name: Check for changes + id: git-check + run: | + git diff --quiet || echo "changes=true" >> $GITHUB_OUTPUT + + - name: Commit and push changes + if: steps.git-check.outputs.changes == 'true' + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + + git add -A + git commit -m "chore: format code" + git push \ No newline at end of file diff --git a/package.json b/package.json index cae01180..a8a83225 100644 --- a/package.json +++ b/package.json @@ -5,7 +5,7 @@ "description": "Meshtastic web client", "license": "GPL-3.0-only", "scripts": { - "build": "pnpm check && rsbuild build", + "build": "rsbuild build", "build:analyze": "BUNDLE_ANALYZE=true rsbuild build", "check": "biome check src/", "check:fix": "pnpm check --write src/", diff --git a/src/components/Form/FormSelect.tsx b/src/components/Form/FormSelect.tsx index bd0e24f0..98b4e6b0 100644 --- a/src/components/Form/FormSelect.tsx +++ b/src/components/Form/FormSelect.tsx @@ -13,6 +13,7 @@ import { Controller, type FieldValues } from "react-hook-form"; export interface SelectFieldProps extends BaseFormBuilderProps { type: "select"; + selectChange?: (e: string) => void; properties: BaseFormBuilderProps["properties"] & { enumValue: { [s: string]: string | number; @@ -40,7 +41,10 @@ export function SelectInput({ : []; return (