问题
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