1

I've the Salesforce Lightning code and referring the link https://www.npmjs.com/package/salesforce-lightning-cli and where on my local machine I installed the Nodejs and Heroku. Now I can successfully utilized the command line which scans my Lightning code and gives me the coding conventions & suggestions.

But, real problem which I see that each user has to manually setup the Nodejs and Heroku on their machine (have 150 SFDC developers) in my team. Instead of asking each developer to setup the code, I need to have a setup somewhere (on server) where we will upload the code and scan the code and result will display on server only.

What is the best/correct way to do it ?

1
  • @Mohit - Can we add some custom rules per our choice into the CLI or web warpper? Is this possible ? Jun 21 '17 at 10:53
2

You can use the online linter for the same .

It is not officially supported but it exists as an heroku application

https://lightning-linter.herokuapp.com/

You just salesforce login and it will automatically scan the code and let you know the vulnerabilities .

9
  • Mohit - Thnx. Do we have a facility to upload folder/.zip file also if we dont have access to that org etc ? Please guide ! May 19 '17 at 16:34
  • I login into the salesforce already and login into heroku app, but I see nothing is happening May 19 '17 at 17:01
  • If you have lightning components it does show you any rule thats been violated .There is no provision to upload zip file May 19 '17 at 17:41
  • Can we add our custom rules ? Its a nice utility. May 19 '17 at 18:14
  • I doubt you can add your custom rules . What you can do is to clone the repo as it is open source project and put your custom rules and deploy to the heroku instance .Hope that helps May 19 '17 at 18:25
0

If I were you I'd use npm/node as intended and create a package.json file and commit it to a git repo with the developer dependencies. You can add scripts to be executed using npm via the npm run command for ensuring the lightning Cli is installed. Your developers will have to pull from the repo and run some setup prior to being able to use the client, but that's just the cost of modern development. Using an online tool is going to be more costly in time and efficiency.

1
  • Not sure I agree with this "Using an online tool is going to be more costly in time and efficiency." in the context of this question
    – Eric
    May 19 '17 at 23:48
0

If you use CI/CD, you can use Mega-Linter , a 70 linters aggregator, including sfdx-scanner (apex PMD + eslint)

This does not solve the issue locally (except if your computer have docker, in that can you can run Mega-Linter locally), but at least it will block junior issues to be deployed in your shared code base

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.