Skip to content

Commit

Permalink
feat: add biome commit hook
Browse files Browse the repository at this point in the history
  • Loading branch information
duongdev committed Sep 21, 2024
1 parent a1011e8 commit 5e1b0b2
Show file tree
Hide file tree
Showing 8 changed files with 129 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"commands": [
{
"match": "\\.(ts|tsx|js|jsx|html)$",
"cmd": "pnpm biome lint ${file} --apply-unsafe"
"cmd": "pnpm biome lint ${file} --unsafe"
}
]
}
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/components/ui/dropdown-menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
return (
<TextClassContext.Provider
value={cn(
'select-none text-sm native:text-lg text-foreground',
'select-none native:text-lg text-foreground text-sm',
open && 'native:text-accent-foreground',
)}
>
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/components/ui/input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Input = React.forwardRef<
className,
)}
placeholderClassName={cn(
'text-muted-foreground font-regular',
'font-regular text-muted-foreground',
placeholderClassName,
)}
{...props}
Expand Down
2 changes: 1 addition & 1 deletion apps/mobile/components/ui/tabs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const TabsTrigger = React.forwardRef<
return (
<TextClassContext.Provider
value={cn(
'text-sm native:text-base font-medium text-muted-foreground web:transition-all',
'font-medium native:text-base text-muted-foreground text-sm web:transition-all',
value === props.value && 'text-foreground',
)}
>
Expand Down
8 changes: 6 additions & 2 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
"files": {
"ignoreUnknown": true,
"ignore": ["apps/mobile/scripts/*"]
},
"formatter": {
"enabled": true,
"formatWithErrors": false,
Expand All @@ -20,7 +24,7 @@
"fix": "safe",
"options": {
"attributes": ["className"],
"functions": ["clsx", "cva", "tw"]
"functions": ["clsx", "cva", "tw", "cn"]
}
}
},
Expand Down Expand Up @@ -236,7 +240,7 @@
"noCommentText": "error",
"noCompareNegZero": "error",
"noConfusingLabels": "error",
"noConsoleLog": "warn",
"noConsoleLog": { "fix": "none", "level": "warn" },
"noControlCharactersInRegex": "error",
"noDebugger": "error",
"noDoubleEquals": "error",
Expand Down
8 changes: 8 additions & 0 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Refer for explanation to following link:
# https://github.com/evilmartians/lefthook/blob/master/docs/configuration.md

pre-commit:
commands:
check:
glob: "*.{js,ts,cjs,mjs,d.cts,d.mts,jsx,tsx,json,jsonc}"
run: pnpm run -r "check" --write --no-errors-on-unmatched --files-ignore-unknown=true --colors=off --unsafe {staged_files}
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@
"name": "6pm",
"version": "1.0.2",
"license": "GPL-3.0",
"workspaces": ["apps/*", "packages/*"],
"workspaces": [
"apps/*",
"packages/*"
],
"scripts": {
"api:dev": "pnpm --filter @6pm/api run dev",
"api:build": "pnpm --filter @6pm/api run build",
Expand All @@ -20,11 +23,16 @@
"@lingui/cli": "^4.11.1",
"@lingui/macro": "^4.11.1",
"babel-plugin-macros": "^3.1.0",
"conventional-changelog-cli": "^5.0.0"
"conventional-changelog-cli": "^5.0.0",
"lefthook": "^1.7.15"
},
"pnpm": {
"peerDependencyRules": {
"ignoreMissing": ["@babel/*", "expo-modules-*", "typescript"]
"ignoreMissing": [
"@babel/*",
"expo-modules-*",
"typescript"
]
},
"overrides": {
"react": "18.3.1"
Expand Down
100 changes: 100 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 5e1b0b2

Please sign in to comment.