one solution can be to disable the typescript check. so inside the settings.json
add the below code line
"javascript.validate.enable": false
// @ts-check
module.exports = {
someMethod: (param: string): string => {
return param;
},
};
Ensure I had lang="ts" as an attribute in my script tag (as described above)