eclipse 从 SonarLint 中排除 JS 文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33660091/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 22:56:41  来源:igfitidea点击:

Exclude JS files from SonarLint

eclipseperformancesonarlint

提问by Valijon

I use SonarLint in my Eclipse to analyze JAVA web project.

我在 Eclipse 中使用 SonarLint 来分析 JAVA web 项目。

How to exclude jsfiles from SonarLintanalysis? It is because when I open js file, SonarLint starts to slow down the Eclipse performance.

如何jsSonarLint分析中排除文件?这是因为当我打开 js 文件时,SonarLint 开始降低 Eclipse 的性能。

Used version:

使用版本:

SonarLint for Eclipse   1.0.0.20151015-1547-RELEASE

Thanks

谢谢

回答by Duarte Meneses

Go to Window->Preferences, SonarLint->Scanner Properties and add the properties:

转到 Window->Preferences, SonarLint->Scanner Properties 并添加属性:

sonar.exclusions=**/*.js
sonar.test.exclusions=**/*.js

More information about this: http://docs.sonarqube.org/display/SONAR/Narrowing+the+Focus

有关此的更多信息:http: //docs.sonarqube.org/display/SONAR/Narrowing+the+Focus

SonarLint will still be triggered but it will skip all files that are JS source files. You can tune the exclusions to only exclude a subset of the js files. Also note that since SonarLint Eclipse 1.1, derived resources are excludedfrom the analysis.

SonarLint 仍然会被触发,但它会跳过所有 JS 源文件。您可以调整排除项以仅排除 js 文件的一个子集。另请注意,自 SonarLint Eclipse 1.1 起,派生资源被排除在分析之外。

回答by Karan Desai

If someone bumps in here looking for steps for Visual Studio 2015, here is how its done in Visual Studio:

如果有人在这里寻找Visual Studio 2015 的步骤,以下是在 Visual Studio 中的完成方式:

  1. Go to Tools>Options>SonarLint For Visual Studio
  2. Click Deactivate
  1. 转到“工具”>“选项”> “Visual Studio 的 SonarLint”
  2. 单击停用

sonarlint

声纳林特

And that's it, now js files won't be analyzed

就是这样,现在不会分析 js 文件

Note: This does not exclude, but deactivateJs support. If you want to specify exclusion rules,then mention the same in SonarQube project which is bound in Visual Studio. (In connected mode, sonarlint uses configuration from SonarQube)

注意:这并不排除,而是停用Js 支持。如果要指定排除规则,请在 Visual Studio 中绑定的 SonarQube 项目中提及相同的规则。(在连接模式下,sonarlint 使用来自 SonarQube 的配置