script with onload show "statment expected"


I have a piece of code

<div id="gpay"></div>
<script async onload="onGooglePayLoaded()" src=""></script>

And webstorm at the end of script says "statement expected". Also in following lines on empty spaces it reports "Expecting newline or semicolon"

The code is valid, compiles and works. However, I do not know how to turn off or disable html inspection for this particular piece

You can replicate issue by copy pasting


<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<div id="gpay"></div>
<script async onload="onGooglePayLoaded()" src=""></script>
<div class="margin"></div>

Ah I see. Is there any way of ignoring inspection for HTML like in JS or typescirpt files?


it's not an inspection unfortunately, it's a syntax error reported by parser:( Such errors can't be suppressed like inspections, the only way to get rid of it is turning file highlighting level to None using Hector icon in lower right corner:


You will then need to re-open the project to get highlighting updated


Please sign in to leave a comment.