SonarJS - how to avoid “Non-existent variables should not be referenced” issue

老子叫甜甜 提交于 2019-12-01 13:02:39

问题


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.



来源:https://stackoverflow.com/questions/42268346/sonarjs-how-to-avoid-non-existent-variables-should-not-be-referenced-issue

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