-
Notifications
You must be signed in to change notification settings - Fork 613
[CHORE][SECURITY]: Eliminate all lint issues in web stack #338
Description
🔧 Chore Summary
Fix remaining 16 lint issues in web stack after auto-formatting - 14 JavaScript errors and 2 HTML validation errors that require manual code changes.
🧱 Area Affected
Choose the general area(s) that this chore affects:
- Pre-commit hooks / linters
- Other: Code refactoring for ESLint compliance & HTML validation
⚙️ Context / Rationale
After running auto-formatting, we've reduced lint issues from 312 to 16. The remaining issues require manual intervention:
HTML (2 errors):
- Missing closing
</div>tag causing structure mismatch - Missing DOCTYPE declaration in partial template
JavaScript (14 errors):
- Variable naming convention violations (camelCase)
- Unused code that should be removed or utilized
- Undefined global variable references
These fixes will achieve zero-lint status and improve code quality.
📦 Related Make Targets
Reference any relevant Makefile targets that are involved, if applicable. Ex:
make lint-web- runs HTML/CSS/JS lintersmake install-web-linters- installs npm-based linters
📋 Acceptance Criteria
Define what "done" looks like for this task.
- HTML Fixes (2)
- Add missing
</div>closing tag inadmin.htmlafter line 39 - Add DOCTYPE to
version_info_partial.htmlOR configure HTMLHint to skip partials
- Add missing
- JavaScript Variable Naming (8)
- Rename
is_inactive_checked→isInactiveChecked(lines: 183, 199, 328, 339, 606, 613) - Rename
base_url→baseUrl(lines: 1298, 1319)
- Rename
- JavaScript Unused Code (4)
- Remove unused function
protectInputPrefix(line 778) - Remove unused variable
end(line 806) - Remove unused function
testGateway(line 1256) - Remove unused variable
toolTestResultEditor(line 2129) OR use it properly
- Remove unused function
- JavaScript Undefined Variables (2)
- Add
/* global CodeMirror */at top of file OR check forwindow.CodeMirror(lines: 1260, 1271)
- Add
- All linters pass with 0 errors
- Admin UI functionality verified after changes
🧩 Additional Notes
Quick fixes:
-
For
CodeMirrorundefined errors, add at the top ofadmin.js:/* global CodeMirror */OR change references to
window.CodeMirror -
For HTML partial doctype issue, either:
- Add to
.htmlhintrc:"doctype-first": falsefor partials - OR wrap partial content check:
{% if not is_partial %}<!DOCTYPE html>{% endif %}
- Add to
-
Variable renaming can be done with find/replace:
is_inactive_checked→isInactiveCheckedbase_url→baseUrl
-
For unused code, verify it's truly unused before removal:
protectInputPrefix- appears to be dead codetestGateway- might be referenced in HTML onclick attributestoolTestResultEditor- check if it should be stored in AppState
Testing checklist:
- Test inactive item toggles work correctly
- Test gateway testing functionality
- Verify CodeMirror editors still initialize
- Check all modals open/close properly