2

I am using HighCharts for drawing some reports in Lightning Component. HighCharts is loaded from static resource and all expected functionalities are working fine with Locker Service ON. This is a part of AppExchange solution. As a preparation for security review when the code is scanned with Lightning CLI, Highcharts initialization in code is flagged as 'Invalid SecureWindow API'. I am looking for any workarounds avoid the CLI scan flagging.

error secure-window Invalid SecureWindow API
Line:113:31
YTDChartObj = new Highcharts.Chart({ ^

error no-undef 'Highcharts' is not defined
Line:191:51

((Highcharts.theme && Highcharts.theme.contrastTextColor) || 'black') + '">' + Highcharts.numberFormat(YTDBooking, 0, ',', ',') + '
' +

                                                 ^
2

The CLI (its just using eslint with a custom rules config BTW) currently has no visibility into the static resources that you are including in your components and unfortunately defaults to this rather distressing looking error message. I believe if you update to the latest version of the CLI these have been toned down a bit to warnings. Also, you can configure the CLI locally to ignore specific things.

| improve this answer | |
  • 1
    Thanks Doug for sharing the info. I hope we can safely ignore this warning as of now and wont be flagged by the Security review team when submitted for AppExchange review. – Pintu Francis Feb 20 '17 at 5:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.