Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable VS Code javascript check

I am passing a twig object to javascript via script tags in a .html.twig file, and VS Code complains that "Property assignment expected. js [17, 38]". Is it possible to turn this off completely for .html.twig-files or perhaps turn off checking altogether? I am using ESLint extension in any case.

    <script>
    ...
    window.PROPS = {{ props|json_encode|raw }};
    ...
    </script>

Problems that are really not problems and that I wish to get rid of.

(edit) Just to clarify, ESLint is not responsible for these problem-messages. I can turn off the ESLint extension (and reload the window); the messages remain.

like image 333
Sheepwall Avatar asked Jan 30 '26 03:01

Sheepwall


1 Answers

There is another setting in VS Code for Javascript inside script tags:

in settings.json, set

"html.validate.scripts": false
like image 168
Sheepwall Avatar answered Feb 01 '26 18:02

Sheepwall



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!