eslint-plugin-aura
Salesforce Lightning (Aura) specific linting rules for ESLint.
Installation
npm install --save-dev @salesforce/eslint-plugin-aura
Usage
Add this plugin to your ESLint configuration and extend your desired configuration. See
ESLint documentation for details.
Example:
{
"plugins": ["@salesforce/eslint-plugin-aura"],
"extends": [
"plugin:@salesforce/eslint-plugin-aura/recommended",
"plugin:@salesforce/eslint-plugin-aura/locker"
]
}
Rules
Aura
Locker
Configurations
This package exposes 2 configurations for your usage.
@salesforce/eslint-plugin-aura/recommended
configuration
Goal:
Prevent common pitfalls with Lightning component development, and enforce other Salesforce platform restrictions.
Rules:
@salesforce/eslint-plugin-aura/locker
configuration
Goal:
Prevent Lightning Locker violations.
Rules:
@salesforce/eslint-plugin-aura/recommended
rules.- Proper usage of
document
and window
via the secure-document
and secure-window
rules, respectively. - Proper usage of Javascript intrinsic APIs via the
ecma-intrinsics
rule.