Lightning CLI is code linting tool, which can be used to validate source code of Lightning components (Javascript files only). This tool is made specially keeping Locker Service in mind where we can validate if Lightnign component is breaking any contract while trying to access DOM element out of its own scope.
Lightning CLI is based on open source project ESLint. Below video demonstrates how we can install Lightning CLI and use it for existing Lightning Components. You can subscribe to my youtube channel to get latest update on Salesforce related videos.
Use below command to install heroku CLI plugin, assuming you already have heroku installed :
heroku plugins:install salesforce-lightning-cli
Get code review comments on screen as a text
heroku lightning:lint .
Get code review comment on screen as a JSON
heroku lightning:lint . -j
Export code review comments in a file
heroku lightning:lint . > CodeReview.txt OR heroku lightning:lint . -j > CodeReview.json
To export code review feedback generated by Salesforce Lightning CLI tool, refer this blog post.
Related Resources :
Leave a Reply