Disable VS Code javascript check

a 夏天 提交于 2021-01-07 06:02:30

问题


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>

(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.


回答1:


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

in settings.json, set

"html.validate.scripts": false



回答2:


You can turn off JavaScript validation off through the javascript.validate.enable setting in VS Code settings.



来源:https://stackoverflow.com/questions/59056875/disable-vs-code-javascript-check

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!