DEP-004 recommended language-tooling
TypeScript over JavaScript
TypeScript configured with strict mode, source files predominantly .ts/.tsx
Question to ask
"Still shipping .js files because strict mode felt too hard?"
Verification guide
Severity: Recommended
Check automatically:
Look for TypeScript configuration:
ls -la tsconfig.json tsconfig.*.json 2>/dev/nullCount file extensions:
# TypeScript files find . -type f \( -name "*.ts" -o -name "*.tsx" \) -not -path "./node_modules/*" -not -path "./dist/*" | wc -l # JavaScript files (excluding config files) find . -type f \( -name "*.js" -o -name "*.jsx" \) -not -path "./node_modules/*" -not -path "./dist/*" -not -name "*.config.js" -not -name "*.config.mjs" | wc -lCheck for partial migration (both TS and JS source files):
# List JS files in src/ that aren't configs find ./src -type f \( -name "*.js" -o -name "*.jsx" \) 2>/dev/nullCheck tsconfig strictness:
cat tsconfig.json | jq '{strict: .compilerOptions.strict, noImplicitAny: .compilerOptions.noImplicitAny, strictNullChecks: .compilerOptions.strictNullChecks}' 2>/dev/null
Note: This applies to Node.js/frontend projects. Skip for Python, Go, etc.
Pass criteria:
- Project uses TypeScript (tsconfig.json exists)
- Source files are predominantly .ts/.tsx
- Strict mode enabled (
"strict": true) or key strict flags set
Fail criteria:
- Pure JavaScript project with no TypeScript
- TypeScript configured but
strict: falseand no strict flags - Mixed codebase with significant JS files in src/ (partial migration stalled)
If JavaScript project, ask user: "Project uses JavaScript instead of TypeScript. Is there a plan to migrate, or a reason TypeScript isn't suitable here?"
If partial migration, ask user: "Found [X] JavaScript files alongside TypeScript. Is migration in progress? What's the timeline?"
Evidence to capture:
- tsconfig.json exists (yes/no)
- File count: .ts/.tsx vs .js/.jsx
- Strict mode status
- Any JS files in src/ that should be migrated