Export Salesforce Lightning CLI code review report

Export or print code review feedback generated by Salesforce Lightning CLI

Update : We can use this heroku app to scan Lightning component online and get code review feedback. Complete source code is available here. We don’t need to install Lightning CLI until its project compliance issue.

Salesforce Lightning Component - Code review - Javascript lint
Salesforce Lightning Component – Code review – Javascript lint

In this post, we discussed that how Lightning CLI can be used to get a code review information of custom Lightning component. However, code review is either printed or exported as a file in text or JSON format. Question is, how to get Lightning component code review feedback in HTML or PDF format ?

I tried various options available here however there were no way to export code review feedback generated by Lightning CLI. Output generated by Lightning CLI is not presentable to business executives or clients.

Finally, I came up with very simple Heroku application, which can be used to get Lightning CLI code review feedback in HTML or pdf format. We need to run below command to get CLI code review in JSON format.

 heroku lightning:lint . -j > CodeReview.json

Once JSON file (CodeReview.json) is created, copy and paste its content in text box of this application and click on convert to HTML button. It will ignore all blank results of Lightning component and only displays actual result. We can sort on various columns as well. To export this table, simply click on print icon. Complete source code is available here.

Posted

in

by


Related Posts

Comments

3 responses to “Export or print code review feedback generated by Salesforce Lightning CLI”

  1. Savani S Avatar
    Savani S

    How we can run this code ?

    1. Savani S Avatar
      Savani S

      How we can render the output in the PDF formats ?

  2. Christian Szandor Knapp Avatar

    There are also plugins for lighting linter availble for at least Atom, Code and soon Force.com IDE 2 – we’ve also integrated the linter into our CI process

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Discover more from Jitendra Zaa

Subscribe now to keep reading and get access to the full archive.

Continue Reading