Sunday 6 August 2017

Installing Lightning CLI and Scanning #Salesforce Lightning Component Code

This blog post is about installing Salesforce Lightning CLI, and how to scan your lightning component code for javascript coding issues and lighting issues. 

Lightning CLI alerts you to specific issues related to LockerService. Issues that are flagged include incorrect Lightning components code, and usage of unsupported or private JavaScript API methods. Lightning CLI installs into the Heroku Toolbelt, and is used on the command line.

Salesforce Lightning CLI is Heroku toolbelt plugin, need to install Heroku toolbelt, Lightning CLI relieas on Heroku toolbelt, so if you don't have Heroku installed, please install from the below link.

After installing Heroku, open cmd, and login to Heroku, git bash doesn't have this option of login to heroku, so need to use cmd only.

After successfull installation of heroku, check for node and npm, and then check for the version of theirs, and then install Lighting CLI

Enter below command

heroku plugins:install salesforce-lightning-cli

You have successfully installed Lightning CLI now. Its time to run and scan your lightning component JS code now.
You can scan a Lightning component in one shot, or a single JS file, to scan enter below command

heroku lightning:lint  ...path-of-your-lightning-component

Here is how Lightning CLI shows the component code errors, 

Above snapshot shows, what you need to modify in the controller and helper code, as it only scans the JS files.

Important links

Thanks !
Hope it helps.

1 comment:

  1. Sean runs a little electrical business in Birmingham. he's often on the road and he features a small team of admin staff working for him and he also outsources to electrical contractors in several parts of the West Midlands. When Sean receives a turn his business landline from a possible customer the decision diverts straight to his mobile in order that he can answer the decision . If Sean is on employment and he knows that he can't answer the decision he can arrange for it to divert back to the landline where hopefully somebody from his admin team will devour . this manner Sean doesn't miss any important business calls.Sean is additionally looking to grow his business but he can't afford to line up different offices. Instead he arranges to possess virtual local landline numbers found out that undergo to his mobile. for instance , one among his electrical contractors is predicated in Kidder minster so Sean arranges for a virtual local landline for Kidder minster to be found out .

    Cheap Essay Writing Service