Skip to content

[chore/MAT-655] monorepo lint/typecheck/format 인프라 정합#336

Merged
sterdsterd merged 2 commits into
developfrom
chore/monorepo-lint-typecheck-format-infra
May 19, 2026
Merged

[chore/MAT-655] monorepo lint/typecheck/format 인프라 정합#336
sterdsterd merged 2 commits into
developfrom
chore/monorepo-lint-typecheck-format-infra

Conversation

@sterdsterd
Copy link
Copy Markdown
Collaborator

Summary

Monorepo의 lint/typecheck/format 인프라가 workspace별로 분산·drift되어 (1) admin typecheck가 코드 에러를 silent 통과시키고 (2) native lint가 CI에서 사실상 안 돌고 (3) prettier 플러그인 버전 충돌로 PR-2(#334)에서도 CI fail이 났던 부분을 한 번에 정합화합니다.

Linear

Changes

1. Admin typecheck silent pass 수정 (MAT-655)

  • apps/admin/package.json typecheck script: tsc --noEmittsc -b --noEmit (composite references 추적)
  • 노출된 누적 TS 에러 6건 수정:
    • EditConceptModal.tsx MouseEvent generic을 HTMLDivElementHTMLElement로 확장 (호출자가 <button>)
    • adminPermissions.ts:288 matches[0]!.item non-null 단언 (matches.length === 0 가드 직후)
    • useInvalidate.ts invalidateNotice / invalidateMockExamResults를 array-prefix queryKey로 변경 (부분 매치 invalidation — required studentId query param 우회)
    • useProblemEssentialInput.ts ProblemType import → CreateType으로 정정 ('GICHUL_PROBLEM'은 CreateType 소속, ProblemType은 MAIN/CHILD)

2. Native lint를 CI에 포함

  • package.json ci:lint: turbo lint --filter=...turbo lint (모든 workspace 실행, native expo lint 포함)
  • 새 enforcement로 노출된 native lint errors 33건을 lint --fix로 자동 정리

3. Prettier 플러그인 scope 분리

  • apps/native/.prettierrc 신규 — root는 admin(Tailwind v4) 기준 prettier-plugin-tailwindcss@^0.6.14, native는 NativeWind 4 + Tailwind v3 기준 v0.5.14. prettier의 nearest-wins 정책으로 native 파일은 native 로컬 플러그인이 정렬

4. Turbo 캐시 무결성

  • turbo.json lint/typecheck task에 inputs 명시 (eslint config, prettier config, tsconfig) — config 변경 시 캐시 자동 무효화

Testing

로컬 검증 (worktree .omc/worktrees/infra):

  • pnpm typecheck PASS (5/5 workspaces)
  • pnpm ci:lint PASS (5/5, native 포함)
  • pnpm format:check PASS

Risk / Impact

  • 영향 범위: monorepo CI 게이트가 엄격해짐. 본 PR 머지 후 MAT-746 사이클의 PR-1 (#TBD), PR-2 ([chore/MAT-746] 학생앱 심사 native 설정 통합 #334), PR-3 (#TBD)는 rebase 필요. rebase 단계에서 추가 native lint/typecheck 에러가 노출되면 jointly 처리 예정
  • 확인 필요한 부분: 백엔드 schema 변경 없음. UI 동작 변경 없음. invalidateNotice/invalidateMockExamResults의 queryKey 형식이 prefix array로 바뀌었으나, tanstack query는 prefix 기준 부분 매치라 기존 호출 사이트 동작 동일
  • 배포 시 유의사항: develop 머지 직후 다른 in-flight PR들이 이 PR을 base로 rebase해야 함

Addresses several pre-existing infrastructure drift issues:

1. Admin typecheck silent pass (MAT-655)
   - apps/admin/package.json: typecheck "tsc --noEmit" -> "tsc -b --noEmit"
     so composite references (tsconfig.app.json + tsconfig.node.json) are
     actually checked.
   - Fix 6 accumulated TS errors the silent script was hiding:
     * EditConceptModal MouseEvent generic widened to HTMLElement
     * adminPermissions.ts non-null assertion after length guard
     * useInvalidate invalidateNotice/MockExamResults use array-prefix
       queryKey for partial-match invalidation without studentId param
     * useProblemEssentialInput ProblemType -> CreateType ('GICHUL_PROBLEM'
       belongs to CreateType, not ProblemType)

2. Native lint missing from CI
   - package.json ci:lint switched from filtered list to plain
     "turbo lint" so every workspace runs (including native expo lint).
   - Auto-fix 33 native lint errors surfaced by new enforcement.

3. Prettier plugin version drift
   - apps/native/.prettierrc added so prettier nearest-wins config
     picks up native's local prettier-plugin-tailwindcss@0.5.14
     (NativeWind 4 / Tailwind v3) instead of root v0.6.14 (admin
     Tailwind v4).

4. Turbo pipeline inputs
   - turbo.json lint/typecheck declare explicit inputs (eslint, prettier,
     tsconfig) so cache invalidates on config changes.

Verification:
- pnpm typecheck PASS (5/5 workspaces)
- pnpm ci:lint PASS (5/5, native now included)
- pnpm format:check PASS
@linear
Copy link
Copy Markdown

linear Bot commented May 19, 2026

MAT-655

@vercel
Copy link
Copy Markdown

vercel Bot commented May 19, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pointer-admin Ready Ready Preview, Comment May 19, 2026 7:25pm

CI typecheck was failing after admin tsc -b enforcement because
admin depends on:
- @repo/pointer-editor-v2 dist/ (workspace package, not built by pnpm install)
- routeTree.gen.ts (generated by @tanstack/router-plugin during vite build)

Changes:
- turbo.json typecheck: dependsOn ['^typecheck', '^build'] so workspace
  packages build their dist/ before any typecheck runs.
- apps/admin typecheck script: 'tsr generate && tsc -b --noEmit' so
  routeTree.gen.ts is regenerated before composite typecheck runs.
- Add @tanstack/router-cli as devDep for tsr CLI.
- Remove invalidateNotice (dead code, zero callers) from useInvalidate
  to avoid the array-prefix queryKey shim that broke pattern parity
  with the rest of the file.
@sterdsterd sterdsterd merged commit 3b97805 into develop May 19, 2026
4 checks passed
@sterdsterd sterdsterd deleted the chore/monorepo-lint-typecheck-format-infra branch May 19, 2026 19:53
@sterdsterd sterdsterd self-assigned this May 26, 2026
@sterdsterd sterdsterd added the 🧹 Chore 패키지 매니저 수정, 그 외 기타 수정 label May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🧹 Chore 패키지 매니저 수정, 그 외 기타 수정

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant