New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[html] A 'return' statement can only be used within a function body #143220
Comments
That's not a valid javascript function to be used for the callback. You can see samples here https://www.w3schools.com/tags/ev_oncontextmenu.asp |
@lramos15 https://stackoverflow.com/a/16987533/11027903 I know it isn't a valid function. But It indeed works to forbidden event handler. |
@tjx666 Ah yes this is a weird edge case of the spec https://www.w3.org/TR/2017/REC-html52-20171214/webappapis.html#the-event-handler-processing-algorithm. Functions which return false don't work but just the string literal |
Yeah I just noticed all of javascript now is erroring out in VS Code cause of the |
I just turned off the HTML setting to validate embedded scripts. For those that don't want to wait for a fix, the setting to turn this off is I couldn't stand the errors in all my HTML files, and the 100+ in the project. |
I'm having the same problem right now. Sorry, I am a newb to coding. How do I turn this off? You said 'html.validate.scripts'. I'm using VS code, and don't know where to find that. Thanks! |
I tried this too, still shows the same error.
…On Fri, Mar 25, 2022 at 12:23 PM RyanHeid ***@***.***> wrote:
I just turned off the HTML setting to validate embedded scripts.
For those that don't want to wait for a fix, the setting to turn this off
is html.validate.scripts.
I couldn't stand the errors in all my HTML files, and the 100+ in the
project. At least for me, actual embedded scripts are nearly non-existent
in my project, aside from the element event handlers.
I'm having the same problem right now. Sorry, I am a newb to coding. How
do I turn this off? You said 'html.validate.scripts'. I'm using VS code,
and don't know where to find that. Thanks!
—
Reply to this email directly, view it on GitHub
<#143220 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADLM2T4GZE6MXAK2E6FQMX3VBYHDDANCNFSM5OSGZDUQ>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Open settings by shortcut Uncheck here: But the stable version next week will fix this. |
I found it, and it solved my issue. Thank you so much! @tjx666 |
I am working in javascript exclusively and this is still an issue. |
@crymic Please file a new issue with
|
The specific setting I mentioned is only for HTML pages. If you are editing .js files, then it won't work. There's a separate setting for that, but it will disable all javascript validation, and probably not what you want. |
Does this issue occur when all extensions are disabled?: Yes/No
Yes.
Steps to Reproduce:
The text was updated successfully, but these errors were encountered: