Newer Version Available

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

Use force:lightning:lint

Run force:lightning:lint just like any other lint command-line tool. The only trick is invoking it through the sfdx command. Your shell window shows the results.

Normal Use

You can run the force:lightning:lint lint tool on any folder that contains Lightning components:

1sfdx force:lightning:lint ./path/to/lightning/components/

force:lightning:lint runs only on local files. Use Salesforce DX or third-party tools to download your component code to your machine. Options include Salesforce CLI commands like force:mdapi:retrieve and force:source:pull, or other tools such as the Force.com IDE, the Ant Migration Tool, or various third-party options.

Note

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

See “Review and Resolve Validation Errors and Warnings” for what to do with the output of running force:lightning:lint.