简体   繁体   English

如何从 vscode 中的 css lint 中排除文件

[英]How do I exclude files from css lint in vscode

VS Code seems to have a built in CSS linter, which is great. VS Code 似乎有一个内置的 CSS linter,这很棒。 But there's a lot of code that I don't want to lint, as shown in the below screenshot.但是有很多我不想整理的代码,如下面的屏幕截图所示。 How do I exclude certain directories from being linted?如何从被 linted 中排除某些目录?

不需要的错误

Unfortunately, VS Code's built-in linter doesn't have an exclusion setting.不幸的是,VS Code 的内置 linter 没有排除设置。 You can only disable specific rules (see css. properties in settings.json).您只能禁用特定规则(见css.在settings.json属性)。

You could try using the stylelint extension with the ignoreFiles setting (see this answer ) instead.您可以尝试使用带有ignoreFiles设置的stylelint扩展(请参阅此答案)。

Use:使用:

{ 
   "css.validate": false 
}

One solution is to exclude the folder in */.vscode/settings.json like this:一种解决方案是像这样排除 */.vscode/settings.json 中的文件夹:

{
"files.exclude": {
  "**/app/**/*.js.map": true,
  "**/app/**/*.js": true,
  "**/node_modules/**": true
}

I had to use:我不得不使用:

{
  "css.lint.unknownProperties": "ignore"
}

In my settings.json在我的settings.json

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM