You can add a JSDOC style comment above the canvas like this:
/** @type {HTMLCanvasElement} */ const canvas = document.getElementById("renderCanvas");
More details in this answer: https://stackoverflow.com/a/61388350/4159530