【问题标题】:Disable lint on single line within django template in vs code在 vs 代码中的 django 模板中的单行上禁用 lint
【发布时间】:2020-11-09 12:24:26
【问题描述】:

鉴于此 html

<div class="img-background" style="background-image: url({% static '/img/information_juniors.jpg' %});">
   <div class="content">
      <h5>Juniors</h5>
      <p>{{ page.juniors }}</p>
   </div>
</div>

是否可以在 VS Code 中包含 django 标签的单行禁用 linting?

出现这些错误

) 预期 css-rparentexpected
预期分号 css-semicolonexpected
预期规则或选择器 css- ruleorselectorexpected
at-rule 或 selector 预期 css-ruleorselectorexpected

我的 args 有这个,但我找不到任何关于 linting 和 django 模板的信息

"python.linting.pylintArgs": [
  "--load-plugins=pylint_django",
  "--disable=C0111", // missing docstring
]

【问题讨论】:

  • 你为什么要pylint和HTML文件? pylint_djangopylint/astroid 知道运行时生成的方法或属性
  • @rioV8 是的,那是我的错误。出于某种原因,vs code 最近开始在我的模板文件下划线并显示这些问题,所以我最初认为是 pylint_django 插件之前停止了它并且可以在模板中关闭。

标签: django visual-studio-code wagtail


【解决方案1】:

出于某种原因,我认为 pylint_django 插件会影响模板 linting,我安装了 django-html 标记的问题消失了

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-11-04
    • 2011-06-28
    • 2011-02-21
    • 1970-01-01
    • 1970-01-01
    • 2020-08-31
    • 2018-11-25
    • 2014-09-16
    相关资源
    最近更新 更多