Skip to content

Commit dd99139

Browse files
committed
fix(ci): resolve biome lint issues and harden auto-fix push step
- Add biome-ignore on normalizedBody variable (used in Astro template, outside Biome JS scope) to prevent false unused-variable warning - Apply biome import order: sort imports alphabetically in demo pages - Apply biome ternary formatting in Icon.astro (cosmetic only) - Use --force-with-lease on push to guard against concurrent pushes while still protecting against accidental overwrite of others' work
1 parent 340b037 commit dd99139

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,19 @@ jobs:
5353
run: |
5454
git config user.name "github-actions[bot]"
5555
git config user.email "github-actions[bot]@users.noreply.github.com"
56-
# actions/checkout leaves a detached HEAD on PR events; push back
57-
# to the source branch explicitly using HEAD_REF when available.
5856
if git diff --quiet; then
5957
echo "No lint fixes needed."
58+
exit 0
59+
fi
60+
git add -A
61+
git commit -m "chore(lint): biome auto-fix"
62+
# actions/checkout leaves a detached HEAD on PR events.
63+
# Push back to the source branch explicitly; --force-with-lease
64+
# prevents overwriting concurrent pushes that aren't ours.
65+
if [ -n "$HEAD_REF" ]; then
66+
git push origin "HEAD:${HEAD_REF}" --force-with-lease
6067
else
61-
git add -A
62-
git commit -m "chore(lint): biome auto-fix"
63-
if [ -n "$HEAD_REF" ]; then
64-
git push origin "HEAD:${HEAD_REF}"
65-
else
66-
git push
67-
fi
68+
git push
6869
fi
6970
7071
smoke:

demo/src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
import Base from "../layouts/base.astro";
32
import { Icon } from "@dallay/astro-icon/components";
3+
import Base from "../layouts/base.astro";
44
55
const icon = "adjustment";
66
---

demo/src/pages/map.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
2-
import Base from "../layouts/base.astro";
32
import { Icon } from "@dallay/astro-icon/components";
3+
import Base from "../layouts/base.astro";
44
---
55

66
<Base>

packages/core/components/Icon.astro

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,10 @@ const normalizedProps = {
118118
// Prevent SVGs from being focusable in IE/Edge and some browsers
119119
focusable: "false" as const,
120120
// Decorative icons must be hidden from the accessibility tree (WCAG 1.1.1)
121-
...(isDecorative
122-
? { "aria-hidden": "true" as const }
123-
: { role: "img" as const }),
121+
...(isDecorative ? { "aria-hidden": "true" as const } : { role: "img" as const }),
124122
...props,
125123
};
124+
// biome-ignore lint/correctness/noUnusedVariables: used in the Astro template below, outside Biome's JS scope
126125
const normalizedBody = renderData.body;
127126
128127
// biome-ignore lint/correctness/noUnusedVariables: viewBox is extracted to remove it from normalizedProps via delete

0 commit comments

Comments
 (0)