workspace-v1/shared/knowledge-base/reference/erp-inmobiliaria-legacy/gamilit/backend/scripts/fix-ts2564.sh
Adrian Flores Cortes 967ab360bb Initial commit: Workspace v1 with 3-layer architecture
Structure:
- control-plane/: Registries, SIMCO directives, CI/CD templates
- projects/: Gamilit, ERP-Suite, Trading-Platform, Betting-Analytics
- shared/: Libs catalog, knowledge-base

Key features:
- Centralized port, domain, database, and service registries
- 23 SIMCO directives + 6 fundamental principles
- NEXUS agent profiles with delegation rules
- Validation scripts for workspace integrity
- Dockerfiles for all services
- Path aliases for quick reference

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2025-12-23 00:35:19 -06:00

56 lines
1.8 KiB
Bash

#!/bin/bash
###############################################################################
# Fix TS2564: Property has no initializer and is not definitely assigned
#
# Adds definite assignment assertion (!) to properties that need it.
#
# Usage:
# chmod +x fix-ts2564.sh
# ./fix-ts2564.sh
###############################################################################
set -e
echo "========================================"
echo "Fixing TS2564 Errors"
echo "========================================"
echo ""
# Counter
FIXED_FILES=0
# Get list of files with TS2564 errors
FILES=$(npx tsc --noEmit 2>&1 | grep "error TS2564" | cut -d'(' -f1 | sort -u)
for file in $FILES; do
if [ -f "$file" ]; then
echo "Processing: $file"
# Backup original file
cp "$file" "$file.bak"
# Fix pattern: Add ! to properties without ?, =, or !
# Pattern matches: " propertyName: Type;" where there's no ?, =, or ! before :
sed -i -E 's/^(\s+)(@[A-Za-z]+.*\n\s+)*([a-zA-Z_][a-zA-Z0-9_]*):\s*([^?!=;]+);$/\1\2\3!: \4;/g' "$file"
# Alternative simpler approach for multi-line decorators:
# Just add ! before : if not already present and no ? or =
perl -i -pe 's/^(\s+)([a-zA-Z_][a-zA-Z0-9_]+):\s*(?!.*[?!=])(.+);$/\1\2!: \3;/' "$file"
FIXED_FILES=$((FIXED_FILES + 1))
fi
done
echo ""
echo "========================================"
echo "Fix Complete"
echo "========================================"
echo "Files processed: $FIXED_FILES"
echo ""
echo "Running TypeScript compiler to verify..."
npx tsc --noEmit 2>&1 | grep -c "error TS2564" || echo "✓ All TS2564 errors fixed!"
echo ""
echo "Backup files created with .bak extension"
echo "To restore: find src -name '*.bak' -exec bash -c 'mv \"\$0\" \"\${0%.bak}\"' {} \\;"