Collection of ESLint rules for Salesforce Lightning platform.
$ npm install eslint @salesforce/eslint-plugin-lightning --save-dev
Add this plugin to your ESLint configuration and extend your desired configuration. See ESLint documentation for details.
{
"plugin": ["@salesforce/eslint-plugin-lightning"],
"rules": {
"@salesforce/lightning/no-moment": "error",
"@salesforce/lightning/prefer-i18n-service": "error"
}
}
Rule ID | Description | Fixable |
---|---|---|
lightning/no-aura-localization-service | prevent usage of $A.localizationService |
|
lightning/no-moment | prevent usage of moment library |
|
lightning/prefer-i18n-service | suggest usage of @salesforce/i18n-service over direct calls to Intl |
Rule ID | Description | Fixable |
---|---|---|
lightning/valid-apex-method-invocation | enforce invoking Apex methods with the right arguments |