feat: typescript compilation check on CI#39
Conversation
- Introduced a new script for TypeScript type checking in package.json. - Updated tsconfig.json to skip library checks for improved build performance.
- Introduced a new GitHub Actions workflow for TypeScript type checking in the frontend application. - The workflow triggers on pushes and pull requests to the develop branch, ensuring type safety during development. - Configured steps for checking out the code, setting up Node.js, installing dependencies, and running type checks.
📝 WalkthroughWalkthroughAdds a GitHub Actions workflow to run frontend TypeScript type checking on pushes and PRs affecting the frontend. Adds a Changes
Sequence Diagram(s)sequenceDiagram
participant GH as GitHub Actions
participant Runner as Runner
participant Repo as Repository
participant Node as Node.js (v24)
participant Yarn as Yarn
participant TSC as TypeScript Compiler
GH->>Runner: trigger workflow (push/PR)
Runner->>Repo: checkout repository
Runner->>Node: setup Node.js v24
Runner->>Yarn: restore/cache dependencies (frontend/yarn.lock)
Runner->>Repo: npm/yarn install in `frontend` (frozen lockfile)
Runner->>TSC: run `yarn typecheck` -> `tsc --noEmit` in `frontend`
TSC-->>Runner: typecheck results (success/failure)
Runner-->>GH: workflow status
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
No actionable comments were generated in the recent review. 🎉 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Fix all issues with AI agents
In @.github/workflows/typecheck.yml:
- Around line 7-13: The path filters in the workflow use the wrong prefix
("apps/forms_pro/frontend/**") so the workflow never triggers; update both
occurrences under push.paths and pull_request.paths to the actual repo location
("frontend/**") while keeping the workflow file itself
(".github/workflows/typecheck.yml") in the list; modify the paths arrays in the
typecheck.yml triggers to replace "apps/forms_pro/frontend/**" with
"frontend/**" so frontend changes correctly trigger the workflow.
- Around line 33-41: The workflow references non-existent paths; update the
cache-dependency-path and the two working-directory fields used in the "Install
dependencies" and "Type check" steps to the correct frontend directory by
replacing "apps/forms_pro/frontend" with "frontend" (ensure
cache-dependency-path: frontend/yarn.lock and both working-directory: frontend),
and scan the same workflow for any other occurrences of
"apps/forms_pro/frontend" to update them similarly.
In `@frontend/tsconfig.json`:
- Line 23: The tsconfig contains a stray top-level "skipLibCheck" property that
is ignored; remove the top-level "skipLibCheck" entry and ensure the existing
compilerOptions.skipLibCheck value (in the "compilerOptions" object) is the
single source of truth; locate the top-level "skipLibCheck" key and delete it so
only "compilerOptions.skipLibCheck" remains.
| "@/*": ["src/*"] | ||
| } | ||
| }, | ||
| "skipLibCheck": true, |
There was a problem hiding this comment.
Top-level skipLibCheck is not a valid tsconfig property — it has no effect.
skipLibCheck is only recognized inside compilerOptions (already set at line 7). Placing it at the root level is silently ignored by TypeScript. This line should be removed.
Proposed fix
},
- "skipLibCheck": true,
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/main.ts"],📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| "skipLibCheck": true, | |
| }, | |
| "include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue", "src/main.ts"], |
🤖 Prompt for AI Agents
In `@frontend/tsconfig.json` at line 23, The tsconfig contains a stray top-level
"skipLibCheck" property that is ignored; remove the top-level "skipLibCheck"
entry and ensure the existing compilerOptions.skipLibCheck value (in the
"compilerOptions" object) is the single source of truth; locate the top-level
"skipLibCheck" key and delete it so only "compilerOptions.skipLibCheck" remains.
- Simplified paths in the GitHub Actions typecheck workflow to target the frontend directory directly. - Adjusted working directories for dependency installation and type checking to reflect the new structure.
Summary by CodeRabbit