getmymy / mymy-client

마이마이 웹을 관리해요
https://mymy-client.vercel.app
0 stars 0 forks source link

Husky - tsc 이슈 #1

Open nyeoni opened 10 months ago

nyeoni commented 10 months ago

Problem

Expected Behavior

Screenshot

image

Log

✖ tsc:
node_modules/.pnpm/next@13.5.4_react-dom@18.2.0_react@18.2.0/node_modules/next/dist/client/link.d.ts(2,8): error TS1259: Module '"/Users/nyeoni/Repos/mymy-client/node_modules/.pnpm/@types+react@18.2.25/node_modules/@types/react/index"' can only be default-imported using the 'esModuleInterop' flag
src/app/page.tsx(3,31): error TS2307: Cannot find module '@/components/ui' or its corresponding type declarations.
src/app/page.tsx(7,5): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
src/app/page.tsx(9,7): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
src/app/page.tsx(10,7): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
src/app/page.tsx(11,7): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
src/components/ui/button.tsx(3,20): error TS2307: Cannot find module '@/lib/utils' or its corresponding type declarations.
src/components/ui/button.tsx(42,12): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
src/components/ui/index.ts(1,15): error TS6142: Module './button' was resolved to '/Users/nyeoni/Repos/mymy-client/src/components/ui/button.tsx', but '--jsx' is not set.
src/components/ui/index.ts(2,15): error TS6142: Module './input' was resolved to '/Users/nyeoni/Repos/mymy-client/src/components/ui/input.tsx', but '--jsx' is not set.
src/components/ui/input.tsx(3,20): error TS2307: Cannot find module '@/lib/utils' or its corresponding type declarations.
src/components/ui/input.tsx(9,5): error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
husky - pre-commit hook exited with code 1 (error)
nyeoni commented 10 months ago

@Yenowme 그리고 husky 에 tsc 추가한 이유도 궁금합니당! 타입 체크의 목적이라면 tsc --noEmit 으로 결과파일을 막도록 해야할 것 같아요!

nyeoni commented 10 months ago

src/components/ui/button.tsx(42,12): error TS17004: Cannot use JSX unless the '--jsx' flag is provided. 요 에러가 나요!!!!!!!

nyeoni commented 10 months ago

typescript -> javascript 로 파일 추가되는 문제는 tsc --noEmit 로 간단하게 바꿔주면 될거같아유!

nyeoni commented 10 months ago
src/components/ui/button.tsx:3:20 - error TS2307: Cannot find module '@/lib/utils' or its corresponding type declarations.

3 import { cn } from '@/lib/utils';
                     ~~~~~~~~~~~~~

src/components/ui/button.tsx:42:12 - error TS17004: Cannot use JSX unless the '--jsx' flag is provided.

42     return <Comp className={cn(buttonVariants({ variant, size, className }))} ref={ref} {...props} />;
              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Found 2 errors in the same file, starting at: src/components/ui/button.tsx:
nyeoni commented 10 months ago

https://github.com/lint-staged/lint-staged/issues/825