禁用VS Code JavaScript检查 [英] Disable VS Code javascript check

查看:93
本文介绍了禁用VS Code JavaScript检查的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在通过.html.twig文件中的脚本标记将twig对象传递给javascript,而VS Code抱怨说期望属性分配.js[17,38]".是否可以完全关闭.html.twig-files或完全关闭检查?无论如何,我都在使用ESLint扩展.

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)只是为了澄清,ESLint对这些问题消息概不负责.我可以关闭ESLint扩展名(并重新加载窗口);消息仍然保留.

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

推荐答案

在VS Code for Javascript中, script 标签内还有另一个设置:

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

在settings.json中,设置

in settings.json, set

"html.validate.scripts": false

这篇关于禁用VS Code JavaScript检查的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆