SonarJS - how to avoid “Non-existent variables sho

2019-02-21 01:27发布

问题:

I have a JavaScript project that consists of several source files. These files are referenced in <script> tags in index.html page. There are functions and variables defined in those source files and used in other source files. The problem is that Sonar treats those files as independent and I got

Non-existent variables should not be referenced (javascript:S3827)

issue. Can anybody help how to avoid this?

Thanks

Pavel

回答1:

This rule requires configuration. List names of variables and functions shared across files in "sonar.javascript.globals" project property.