Skip to content

Commit

Permalink
chore: add husky pre-commit hooks
Browse files Browse the repository at this point in the history
fix bits-ui components errors in badge, button and toggle
  • Loading branch information
Muhammed-Rahif committed Jan 14, 2025
1 parent e245d5e commit 772ccc7
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pnpm run format
pnpm run lint
pnpm run check
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@
"deploy": "gh-pages -d www -m 'chore(gh-pages): updates' --nojekyll",
"lint": "prettier --check . && eslint . && npx tsc --noEmit --project tsconfig.check.json",
"format": "prettier --write .",
"tauri": "tauri"
"tauri": "tauri",
"prepare": "husky"
},
"devDependencies": {
"@semantic-release/changelog": "^6.0.3",
Expand All @@ -54,6 +55,7 @@
"eslint-plugin-svelte": "^2.46.1",
"gh-pages": "^6.3.0",
"globals": "^15.14.0",
"husky": "^9.1.7",
"prettier": "^3.4.2",
"prettier-plugin-svelte": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.9",
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

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

2 changes: 1 addition & 1 deletion src/lib/components/ui/badge/badge.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
this={href ? 'a' : 'span'}
bind:this={ref}
{href}
class={cn(badgeVariants({ variant, className }))}
class={cn(badgeVariants({ variant }), className)}
{...restProps}
>
{@render children?.()}
Expand Down
4 changes: 2 additions & 2 deletions src/lib/components/ui/button/button.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@
</script>

{#if href}
<a bind:this={ref} class={cn(buttonVariants({ variant, size, className }))} {href} {...restProps}>
<a bind:this={ref} class={cn(buttonVariants({ variant, size }), className)} {href} {...restProps}>
{@render children?.()}
</a>
{:else}
<button
bind:this={ref}
class={cn(buttonVariants({ variant, size, className }))}
class={cn(buttonVariants({ variant, size }), className)}
{type}
{...restProps}
>
Expand Down
2 changes: 1 addition & 1 deletion src/lib/components/ui/toggle/toggle.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
<TogglePrimitive.Root
bind:ref
bind:pressed
class={cn(toggleVariants({ variant, size, className }))}
class={cn(toggleVariants({ variant, size }), className)}
{...restProps}
/>

0 comments on commit 772ccc7

Please sign in to comment.