Newer Version Available

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

Validation Rules Used at Save Time

The following rules are used for validations that are done when you save your Lightning component code.

Validation failures for any of these rules prevents saving changes to your code.

Lightning Platform Rules

These rules are specific to Lightning component JavaScript code. These custom rules are written and maintained by Salesforce.

Validate Aura API (aura-api)
This rule verifies that use of the framework APIs is according to the published documentation. The use of undocumented or private features is disallowed.
Validate Secure Document Public API (secure-document)
This rule validates that only supported functions and properties of the document global are accessed.
Validate Secure Window Public API (secure-window)
This rule validates that only supported functions and properties of the window global are accessed.

General JavaScript Rules

These rules are general JavaScript rules, which enforce basic correct use of JavaScript required for Lightning components. These rules are built into the ESLint tool.

Disallow Use of caller and callee (no-caller)
Prevent the use of arguments.caller and arguments.callee. These are also forbidden in ECMAScript 5 and later when in strict mode, which is enabled under Locker Service.
Disallow Extending Native Objects (no-extend-native)
Prevent changing the behavior of built-in JavaScript objects, such as Object or Array, by modifying their prototypes.
Disallow Use of __iterator__ Property (no-iterator)
Prevents using the obsolete __iterator__ property. Use standard JavaScript iterators and generators instead.
Disallow Calling Global Object Properties as Functions (no-obj-calls)
Prevents calling the Math, JSON, and Reflect global objects as though they were functions. For example, Math() is disallowed. This follows the ECMAScript 5 specification.
Disallow Use of __proto__ (no-proto)
Prevents using the obsolete __proto__ property, which was deprecated in ECMAScript 3.1. Use Object.getPrototypeOf() instead.
Disallow Script URLs (no-script-url)
Prevents the use of javascript: URLs.
Disallow with Statements (no-with)
Prevents using with statements, which adds members of an object to the current scope in a way that makes it hard to predict or view impact or behavior.