Newer Version Available

This content describes an older version of this product. View Latest

Use Salesforce Lightning CLI

Run Lightning CLI just like any other lint command line tool. The only trick is invoking it through the heroku command. Your shell window shows the results.

Normal Use

You can run the Lightning CLI linter on any folder that contains Lightning components:

1heroku lightning:lint ./path/to/lightning/components/

Lightning CLI runs only on local files. Download your component code to your machine using the Metadata API, or a tool such as the Force.com IDE, the Force.com Migration Tool, or any of a number of third-party options.

Note

See “Review and Resolve Problems” for what to do with the output of running Lightning CLI.

Common Options

Filtering Files

Sometimes you just want to scan a particular kind of file. The --files argument allows you to set a pattern to match files against.

For example, the following command allows you to scan controllers only:

1heroku lightning:lint ./path/to/lightning/components/ --files **/*Controller.js

Ignoring Warnings

Sometimes you just want to focus on the errors. The --quiet argument allows you to ignore warning messages during the linting process.