There is an error in the course videos for windows users in the PowerShell terminal in VScode.
THE FIX CODE IS:
"hooks": { "PostToolUse": [ { "matcher": "Write|Edit", "hooks": [ { "type": "command", "command": "jq -r '.tool_input.file_path' | tr -d '\\r' | { read -r fp; [[ \"$fp\" =~ \\.tsx?$ ]] && npx prettier --write \"$fp\"; } 2>/dev/null || true" } ] } ] }
What changed from the original version:
- tr -d '\r' → -replace '\r','' — strips carriage return characters natively in PowerShell
- read -r fp → direct variable assignment
- 2>/dev/null || true → PowerShell silently ignores errors by default; you can add -ErrorAction SilentlyContinue if needed
There is an error in the course videos for windows users in the PowerShell terminal in VScode.
THE FIX CODE IS:
"hooks": { "PostToolUse": [ { "matcher": "Write|Edit", "hooks": [ { "type": "command", "command": "jq -r '.tool_input.file_path' | tr -d '\\r' | { read -r fp; [[ \"$fp\" =~ \\.tsx?$ ]] && npx prettier --write \"$fp\"; } 2>/dev/null || true" } ] } ] }What changed from the original version: