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:

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

Note

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 various third-party options.

The default output only shows errors. To see warnings too, use the verbose mode option.

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:

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

Verbose Mode

The default output only shows errors so you can focus on bigger issues. The --verbose argument allows you to see warning messages and errors during the linting process.