Newer Version Available

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

Lightning Component Validation Rules

Rules built into Lightning component code validations cover restrictions under LockerService, correct use of Lightning APIs, and a number of best practices for writing Lightning component code. Each rule, when triggered by your code, points to an area where your code might have an issue.

In addition to the Lightning-specific rules we’ve created, other rules are active in Lightning validations, included from ESLint basic rules. Documentation for these rules is available on the ESLint project site. If you encounter an error or warning from a rule not described here, search for it on the ESLint Rules page.

The set of rules used to validate your code varies depending on the tool you use, and the way you use it. Minimal save-time validations catch the most significant issues only, while Salesforce DX tools provide more comprehensive static code analysis.