# Cocos TS Compile Check Sop

> Cocos Creator TS Compile Check SOP

- Skill: `chrislamdev/cocos-ts-compile-check-sop` (Agent Skill)
- Install (CLI): `npx skillmds@latest add chrislamdev/cocos-ts-compile-check-sop`
- Raw SKILL.md: https://api.skillmd.com/api/skills/chrislamdev/cocos-ts-compile-check-sop/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: chrislamdev (https://skillmd.com/u/chrislamdev)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/chrislamdev/cocos-ts-compile-check-sop

---


# Cocos Creator TS Compile Check SOP

Mandatory TypeScript compile check before committing code to a Cocos Creator 3.x project.

## Command

```bash
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

- [ ] `compilerOptions.target`: `"ES2015"` or higher
- [ ] `compilerOptions.module`: `"commonjs"` or `"ES2015"`
- [ ] `compilerOptions.strict`: `true` recommended
- [ ] `compilerOptions.skipLibCheck`: `true` for faster checks
- [ ] `include`: covers all `assets/**/*.ts`

See `references/tsconfig-template.md` for a complete working tsconfig.json.

