From ed239ea830ef5c6f6e1bf51d5ef1a24865e92bd7 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Wed, 27 Nov 2024 21:24:09 +0300 Subject: [PATCH] add husky --- .husky/pre-commit | 1 + apps/web/package.json | 2 +- package.json | 3 +- packages/ui/package.json | 2 +- packages/ui/src/components/ui/button.tsx | 15 ++++-- pnpm-lock.yaml | 64 ++++-------------------- 6 files changed, 26 insertions(+), 61 deletions(-) create mode 100644 .husky/pre-commit diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100644 index 0000000..a845b85 --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1 @@ +npm run lint \ No newline at end of file diff --git a/apps/web/package.json b/apps/web/package.json index 021d626..763ad1c 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -7,7 +7,7 @@ "dev": "next dev --turbopack", "build": "next build", "start": "next start", - "lint": "next lint --max-warnings 0", + "lint": "next lint", "check-types": "tsc --noEmit" }, "dependencies": { diff --git a/package.json b/package.json index 34cf54b..4420cd6 100644 --- a/package.json +++ b/package.json @@ -4,10 +4,11 @@ "scripts": { "build": "turbo build", "dev": "turbo dev", - "lint": "turbo lint", + "lint": "turbo lint -- --fix --max-warnings 0", "format": "prettier --end-of-line lf --write \"**/*.{ts,tsx,md,mjs}\"" }, "devDependencies": { + "husky": "^9.1.7", "prettier": "catalog:", "turbo": "catalog:", "typescript": "catalog:" diff --git a/packages/ui/package.json b/packages/ui/package.json index 12b06fb..21d1c16 100644 --- a/packages/ui/package.json +++ b/packages/ui/package.json @@ -22,7 +22,7 @@ "license": "MIT", "scripts": { "ui": "pnpm dlx shadcn@latest", - "lint": "eslint src/", + "lint": "eslint", "type-check": "tsc --noEmit" }, "devDependencies": { diff --git a/packages/ui/src/components/ui/button.tsx b/packages/ui/src/components/ui/button.tsx index 3ed0e17..c8d2dcb 100644 --- a/packages/ui/src/components/ui/button.tsx +++ b/packages/ui/src/components/ui/button.tsx @@ -19,11 +19,14 @@ const buttonVariants = cva( }, variant: { default: 'bg-primary text-primary-foreground hover:bg-primary/90', - destructive: 'bg-destructive text-destructive-foreground hover:bg-destructive/90', + destructive: + 'bg-destructive text-destructive-foreground hover:bg-destructive/90', ghost: 'hover:bg-accent hover:text-accent-foreground', link: 'text-primary underline-offset-4 hover:underline', - outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground', - secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80', + outline: + 'border border-input bg-background hover:bg-accent hover:text-accent-foreground', + secondary: + 'bg-secondary text-secondary-foreground hover:bg-secondary/80', }, }, }, @@ -38,7 +41,11 @@ const Button = React.forwardRef( ({ asChild = false, className, size, variant, ...props }, ref) => { const Comp = asChild ? Slot : 'button'; return ( - + ); }, ); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index b40a961..c9b74a2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,63 +6,9 @@ settings: catalogs: default: - '@types/node': - specifier: ^20 - version: 20.17.8 - '@types/react': - specifier: ^18.3.1 - version: 18.3.1 - '@types/react-dom': - specifier: ^18.3.1 - version: 18.3.1 - '@vchikalkin/eslint-config-awesome': - specifier: ^2.0.4 - version: 2.0.4 - autoprefixer: - specifier: ^10.4.20 - version: 10.4.20 - class-variance-authority: - specifier: ^0.7.1 - version: 0.7.1 - clsx: - specifier: ^2.1.1 - version: 2.1.1 - eslint: - specifier: ^9.15.0 - version: 9.15.0 - eslint-plugin-tailwindcss: - specifier: ^3.17.5 - version: 3.17.5 - eslint-plugin-turbo: - specifier: ^2.3.0 - version: 2.3.2 - lucide-react: - specifier: ^0.462.0 - version: 0.462.0 - next: - specifier: ^15.0.3 - version: 15.0.3 - postcss: - specifier: ^8.4.49 - version: 8.4.49 prettier: specifier: ^3.2.5 version: 3.4.0 - react: - specifier: 19.0.0-rc-5c56b873-20241107 - version: 19.0.0-rc-5c56b873-20241107 - react-dom: - specifier: 19.0.0-rc-5c56b873-20241107 - version: 19.0.0-rc-5c56b873-20241107 - tailwind-merge: - specifier: ^2.5.5 - version: 2.5.5 - tailwindcss: - specifier: ^3.4.15 - version: 3.4.15 - tailwindcss-animate: - specifier: ^1.0.7 - version: 1.0.7 turbo: specifier: ^2.3.2 version: 2.3.2 @@ -74,6 +20,9 @@ importers: .: devDependencies: + husky: + specifier: ^9.1.7 + version: 9.1.7 prettier: specifier: 'catalog:' version: 3.4.0 @@ -2456,6 +2405,11 @@ packages: hosted-git-info@2.8.9: resolution: {integrity: sha512-mxIDAb9Lsm6DoOJ7xH+5+X4y1LU/4Hi50L9C5sIswK3JzULS4bwk1FvjdBgvYR4bzT4tuUQiC15FE2f5HbLvYw==} + husky@9.1.7: + resolution: {integrity: sha512-5gs5ytaNjBrh5Ow3zrvdUUY+0VxIuWVL4i9irt6friV+BqdCfmV11CQTWMiBYWHbXhco+J1kHfTOUkePhCDvMA==} + engines: {node: '>=18'} + hasBin: true + ignore@5.3.2: resolution: {integrity: sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==} engines: {node: '>= 4'} @@ -6649,6 +6603,8 @@ snapshots: hosted-git-info@2.8.9: {} + husky@9.1.7: {} + ignore@5.3.2: {} import-fresh@3.3.0: