Reputation: 7715
Problem: we are wanting to use SonarJS but much of our old Javascript code uses functions from the Microsoft ASP.Net framework (and the MS AjaxToolkit). As such we have a couple of hundred occurrences of the error "XXX" does not exist. Change its name or declare it so that its usage doesn't result in a "ReferenceError".
(where XXX is Sys, Type, $get etc.).
I appreciate that I could suppress these by specifying them all in the sonar.javascript.globals
property (as per the Elena Vilchik's answer to this question ) but it feels like what I really want to do is to add my own bespoke entries in sonar.javascript.environments
(called msajax and msajaxtoolkit say). Then I could be more precise about when to include / exclude these globals.
So I guess I would like to know whether defining my own environment
is supported or if there is a more elegant solutions overall.
Thanks in advance.
Upvotes: 0
Views: 634
Reputation: 1090
You are more than welcome to open pull request for https://github.com/SonarSource/sonar-javascript. Edit "javascript-frontend/src/main/resources/org/sonar/javascript/tree/symbols/globals.json" by adding new group/groups of names.
Upvotes: 1