“XXX” does not exist. Change its name or declare it so that its usage doesn't result in a “ReferenceError”

感情迁移 提交于 2019-12-11 15:38:33

问题


I have been using sonar in my projects. I get that error

""kendo" does not exist. Change its name or declare it so that its usage doesn't result in a "ReferenceError".

I know it's about global variables. I saw that answer but I don't understand how to use 'sonar.javascript.globals'.

I searched for documentation and I found this doc. But how to implement? What I'm missing?

Anyone to explain how can I define global variables to sonar? Projects are written with ASP.NET, C#, Javascript.


回答1:


If you use the Scanner for MsBuild, add these lines to your .csproj file:

<ItemGroup>
  <SonarQubeSetting Include="sonar.javascript.globals">
    <Value>kendo,kendo2,etc</Value>
  </SonarQubeSetting>
</ItemGroup>

Alternative ways to specify settings are described in the official documentation.



来源:https://stackoverflow.com/questions/45859757/xxx-does-not-exist-change-its-name-or-declare-it-so-that-its-usage-doesnt-re

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