[SalesForce] None of the JS external library work with locker services Salesforce lightning enabled

For my client, I am using Chart.Js and d3. After I have moved my code to new org which has locker service enabled. None of my components work. All the object defined in the JS are throwing undefined error.

What can I do ?

https://developer.salesforce.com/blogs/developer-relations/2016/04/introducing-lockerservice-lightning-components.html
The locker service doc says the below in faq :

Can I use 3rd party libraries (React, Angular, etc) if running in Locker?
Yes​, provided they are served from Static Resources and approved by security.

What does this mean "approved by security" ? Can't we use any other external Js library ?

Also while running the CLI tool, it seems it doesn't consider the scripts in staticresource file. then obviously it will have errors. Right ?

Best Answer

The latest version of Chartjs should work fine but there is a known issue with D3 that make it not entirely strict mode compliant. There is a trivial chance to d3.js you can make that fixes this and we are working with D3 to get the fix into their codebase.

The CLI needs to be hinted using eslint annotations to suppress the errors it logs for unknown global symbols. The CLI and the linter it uses are not part of LockerService's implementation and its reported results are overly strict currently. The real answer is to run your components under locker and test them. The linter is only a starting point tool that helps highlight areas in bulk that might require attention.