After adding // @ts-check
to my JavaScript file for JSDoc usage, I encountered errors in VS Code related to functions included with a script tag:
<script src="imported-file.js"></script>
To suppress these errors, I resorted to using numerous // @ts-ignore
comments. However, this approach made JSDoc/TypeScript more of a hindrance than a help.
This led me to ponder the compatibility of ES6 includes/imports that JSDoc/TypeScript can handle within VS Code. Can it support module imports like the example below?
<script type="module" src="imported-file.js"></script>
Is it capable of dealing with dynamic imports as well?
const myImportedModule = await import("imported-file.js");
Are there any comprehensive resources or documentation available on this topic?
UPDATE: The errors occur when trying to use imported functions declared in "imported-file.js". These functions exist in the global scope (as per JavaScript) just as Jared Smith pointed out. Notably, no JSDoc errors are detected in the "imported-file.js" itself.