I'm experimenting with using TypeScript to the extent possible in Lightning Web Components (as described in this article), and while it works if I put // @ts-check
at the top of my JavaScript file, removing this line and including "checkJs": true
in tsconfig.json
removes the error reporting that TypeScript gives when the check line is the first line of the file.
How can I avoid having to put // @ts-check
at the top of all my JS files? Do I need to specify a path for TypeScript to find the JavaScript files? All our components are found in force-app/core/lwc/
, although if we decide to use TypeScript across our projects, we would have additional lwc
folders (all within force-app
).
I did find this GitHub issue, where a reply says:
And thus
--checkJs
really means nothing without--allowJs
.
So I tried enabling that as well with no change in results. Errors are still not reported without // @ts-check
in the first line.