From c8fd09d16f9df2c312c4190539632a047b282fb9 Mon Sep 17 00:00:00 2001 From: Samir Boulahtit Date: Wed, 31 Dec 2025 21:09:38 +0100 Subject: [PATCH] fix: enable JS-005 through JS-009 checks in main JS validation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The rules JS-005 (init guard), JS-006 (async error handling), JS-007 (loading state), JS-008 (apiClient vs fetch), and JS-009 (Utils.showToast) were defined in _validate_js_file() but never called. Added these checks to the main JavaScript validation loop. This reveals 89 existing violations that need to be addressed. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- scripts/validate_architecture.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/scripts/validate_architecture.py b/scripts/validate_architecture.py index a9a83e83..2f49035a 100755 --- a/scripts/validate_architecture.py +++ b/scripts/validate_architecture.py @@ -2750,6 +2750,21 @@ class ArchitectureValidator: # JS-004: Check Alpine components set currentPage self._check_alpine_current_page(file_path, content, lines) + # JS-005: Check initialization guard + self._check_init_guard(file_path, content, lines) + + # JS-006: Check async error handling + self._check_async_error_handling(file_path, content, lines) + + # JS-007: Check loading state management + self._check_loading_state(file_path, content, lines) + + # JS-008: Check for raw fetch() calls instead of apiClient + self._check_fetch_vs_api_client(file_path, content, lines) + + # JS-009: Check for alert() or window.showToast instead of Utils.showToast() + self._check_toast_usage(file_path, content, lines) + # JS-010: Check PlatformSettings usage for pagination self._check_platform_settings_usage(file_path, content, lines)