Registry / devops / salesforce-lightning-cli

salesforce-lightning-cli

JSON →
library3.0.0jsnpmunverified

Salesforce Lightning CLI (v3.0.0) is a code review tool for scanning Lightning component code for issues related to LockerService. It is based on ESLint and flags unsupported/private APIs, incorrect component code, and general JS issues. It is bundled with Salesforce CLI and also available as a Heroku plugin. It has two rule sets: unmodifiable security rules and customizable style rules. The project appears to be in maintenance mode, with the preferred usage now being through sfdx force:lightning:lint. No updates since 2018.

npm install salesforce-lightning-cli
INSTALL
IMPORT
SIG · SALESFORCE-LIGHTNI
S
salesforce-lightning-cli
devopsjavascriptv3.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Lightning CLI
sfdx force:lightning:lint [path]
heroku lightning:lint [path]
The preferred way to run is via sfdx, not heroku. The heroku plugin is legacy.
Custom rules config
sfdx force:lightning:lint [path] --config [file]
sfdx force:lightning:lint --config [file] [path]
Config file path must come after the folder path. Only style rules can be overridden.
Filtering files
sfdx force:lightning:lint [path] --files **/*Controller.js
sfdx force:lightning:lint [path] --files *.js
The --files argument accepts glob patterns. Use double asterisk for recursive matching.

Runs Lightning CLI linting on a directory, filtering to controller files, and showing warnings.

sfdx force:lightning:lint ./path/to/lightning/components/ --files **/*Controller.js --verbose
Debug
Known issues
deprecatedThe Heroku plugin installation method is deprecated. Use Salesforce CLI (sfdx) instead.
fix
Install Salesforce CLI from https://developer.salesforce.com/tools/sfdxcli and run `sfdx force:lightning:lint`.
affects: >=3.0.0
gotchaLightning CLI only runs on local files. It does not fetch code from the server.
fix
Use Metadata API or Force.com IDE to download components to your machine before linting.
affects: *
gotchaThe --config argument only allows customization of style rules, not security rules.
fix
Security rules are non-modifiable. Copy the default style rules file from lib/code-style-rules.js and modify those.
affects: *
deprecatedLockerService is being deprecated in favor of Lightning Web Security. Lightning CLI may not be updated for new security requirements.
fix
Consider migrating to newer linting tools that support Lightning Web Security.
affects: >=3.0.0
Errors
Common errors & fixes
'heroku' is not recognized as an internal or external command
Heroku Toolbelt is not installed or not in PATH.
fix
Install Heroku Toolbelt from https://devcenter.heroku.com/articles/getting-started-with-nodejs#set-up, or use Salesforce CLI instead.
Error: Cannot find module 'salesforce-lightning-cli'
Plugin not installed or incorrect installation path.
fix
Run `heroku plugins:install salesforce-lightning-cli` or use `sfdx force:lightning:lint` which is bundled with Salesforce CLI.
No files matching pattern: **/*Controller.js
The --files pattern did not match any files in the specified directory.
fix
Verify the directory path and the glob pattern. Use recursive glob (double asterisk) if files are in subdirectories.
Upgrade
Version history
3.0.0latest on npm
Audit
Dependencies
eslintoptionalLightning CLI is built on top of ESLint and uses its rule engine.
@heroku-cli/pluginoptionalCan be installed as a Heroku plugin via heroku plugins:install.
Agent activity
7 hits · last 30 days
node
6
OpenAI (training)
1
Resources
salesforce-lightning-cli — npm install salesforce-lightning-cli · libregistry