From f8e5909ddd3f2a3684cd49b24f856642b7a058f6 Mon Sep 17 00:00:00 2001 From: SevicheCC <91365763+Sevichecc@users.noreply.github.com> Date: Fri, 9 Jun 2023 19:27:12 +0800 Subject: [PATCH] fix: prettier don't work --- .husky/.gitignore | 1 + .husky/pre-commit | 1 + components/ui/theme-provider.tsx | 10 +++++----- package.json | 4 ++++ 4 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 .husky/.gitignore diff --git a/.husky/.gitignore b/.husky/.gitignore new file mode 100644 index 0000000..31354ec --- /dev/null +++ b/.husky/.gitignore @@ -0,0 +1 @@ +_ diff --git a/.husky/pre-commit b/.husky/pre-commit index 58993aa..5926129 100755 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -2,3 +2,4 @@ . "$(dirname -- "$0")/_/husky.sh" pnpm lint +npx lint-staged diff --git a/components/ui/theme-provider.tsx b/components/ui/theme-provider.tsx index 3a8ef58..5944998 100644 --- a/components/ui/theme-provider.tsx +++ b/components/ui/theme-provider.tsx @@ -1,9 +1,9 @@ -"use client" +"use client"; -import * as React from "react" -import { ThemeProvider as NextThemesProvider } from "next-themes" -import { ThemeProviderProps } from "next-themes/dist/types" +import * as React from "react"; +import { ThemeProvider as NextThemesProvider } from "next-themes"; +import { ThemeProviderProps } from "next-themes/dist/types"; export function ThemeProvider({ children, ...props }: ThemeProviderProps) { return {children} -} \ No newline at end of file +} diff --git a/package.json b/package.json index 284b106..08f5065 100644 --- a/package.json +++ b/package.json @@ -47,5 +47,9 @@ "autoprefixer": "^10.4.14", "postcss": "^8.4.24", "typescript": "5.0.4" + }, + "lint-staged": { + "*.js": "eslint --cache --fix", + "*.{js,css,md}": "prettier --write" } } \ No newline at end of file