| name | cocos-ts-compile-check-sop |
| description | Use when running TypeScript compile check on Cocos Creator 3.x project. |
Cocos Creator TS Compile Check SOP
Mandatory TypeScript compile check before committing code to a Cocos Creator 3.x project.
Command
npx tsc --noEmit
Must pass with zero errors before any commit.
Common Errors & Fixes
| Error | Fix |
|---|
Cannot find module 'cc' | Add @cocos/creator-types to tsconfig |
Property 'xxx' does not exist | Check Cocos API version compatibility |
Type 'X' is not assignable | Check Cocos 3.x type differences from 2.x |
tsconfig.json Checklist
See references/tsconfig-template.md for a complete working tsconfig.json.