🧹 Remove explicit 'any' from window object and strongly type custom properties#1046
🧹 Remove explicit 'any' from window object and strongly type custom properties#1046kuasar-mknd wants to merge 1 commit intomasterfrom
Conversation
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
🎯 What: Removed the explicit
anytype assertion on thewindowobject (const win = window as any;) across multiple.astrofiles and correctly extended theWindowinterface insrc/env.d.tswith strict types for all attached custom properties used for singleton listeners and logic.💡 Why: Explicit
anyassertions bypass TypeScript's type checking, creating a risk for typos and unsafe property access. By adding these global event handlers and observer properties to the globalWindowinterface, we achieve full type safety and clearer developer intent. It conforms better to the@typescript-eslint/no-explicit-anylinting rule.✅ Verification: Ran
pnpm run check(formatter, linter, type checker), which successfully passed. Also ranpnpm run buildandpnpm run test:e2e, verifying that these refactors did not introduce any regressions and end-to-end functionality (like lightbox, theme toggle, auto-resizing textareas) remains completely intact.✨ Result: A safer, more robustly typed codebase with properly defined global singleton listeners and better DX due to autocompletion for
window.__*properties.PR created automatically by Jules for task 15537727034846077092 started by @kuasar-mknd