fix(lint): Add ctx shim to routes/auth/totp
- Add credentialManager, totpConfig, saveTotpConfig, session to deps - Create ctx shim for backward compatibility - Fix hasOwnProperty anti-pattern (use Object.prototype.hasOwnProperty.call) Result: 54 errors → 0 errors
This commit is contained in:
13
fix-ctx-routes.sh
Normal file
13
fix-ctx-routes.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
# Systematically fix ctx.* references in all route files
|
||||
|
||||
cd /root/.openclaw/agents/main/workspace/dashcaddy-work/dashcaddy-api
|
||||
|
||||
# Find all route files with ctx errors
|
||||
echo "Finding routes with ctx errors..."
|
||||
for file in $(find routes -name "*.js" -type f | grep -v index.js | grep -v helpers.js); do
|
||||
errors=$(npx eslint "$file" 2>&1 | grep -c "'ctx' is not defined")
|
||||
if [ "$errors" -gt 0 ]; then
|
||||
echo "$errors errors in $file"
|
||||
fi
|
||||
done | sort -rn
|
||||
Reference in New Issue
Block a user