Refactor password reset flow and improve ESLint integration

- Extracted password reset logic into `PasswordResetConfirmContent` wrapped in `Suspense` for cleaner and more modular component structure.
- Updated ESLint config to ignore generated files and added rules for stricter code quality (`eslint-comments`, `@typescript-eslint` adjustments).
- Automated insertion of `eslint-disable` in auto-generated TypeScript files through `generate-api-client.sh`.
- Replaced unsafe `any` type casts with safer `Record<string, unknown>` type assertions for TypeScript compliance.
- Added `lint:tests` script for pre-commit test coverage checks.
- Improved `useAuth` hooks and related type guards for better runtime safety and maintainability.
This commit is contained in:
Felipe Cardoso
2025-11-01 06:04:35 +01:00
parent a062daddc5
commit b8d3248a48
17 changed files with 171 additions and 86 deletions

View File

@@ -55,6 +55,22 @@ else
exit 1
fi
# Add eslint-disable to all generated .ts files
echo -e "${YELLOW}🔧 Adding eslint-disable to generated files...${NC}"
for file in "$OUTPUT_DIR"/**/*.ts "$OUTPUT_DIR"/*.ts; do
if [ -f "$file" ] && ! grep -q "^/\* eslint-disable \*/$" "$file"; then
# Get first line
first_line=$(head -n 1 "$file")
# Add eslint-disable after the auto-generated comment
if [[ "$first_line" == "// This file is auto-generated"* ]]; then
sed -i '1 a /* eslint-disable */' "$file"
else
sed -i '1 i /* eslint-disable */' "$file"
fi
fi
done
echo -e "${GREEN}✓ ESLint disabled for generated files${NC}"
# Clean up
rm /tmp/openapi.json