Unused function with Typescript
Hi,
I would like to know if there is a way to let WebStorm (or PhpStorm) that a function defined in a Typescript file is not unused when I use the function from the generated javascript file.
HTML
<script type='text/javascript' src='commonFunctions.js'></script>
...
<button onClick="testFunction()">Test</button>
Typescript file
function testFunction() {
console.log("Test message");
}
The testFunction in commonFunction.ts is reported as unused which is technically correct since the script tag uses commonFunction.js.
I only develop in TypeScript, the javascript is automatically generated, is there a way to let WebStorm know that the function is not really unused? Maybe something with the commonFunction.js.map file?


Thank you for your help
Please sign in to leave a comment.
No;( I can only suggest suppressing the warning with `Alt+Enter`, `Right`, Suppress for statement