1.0.0 • Published 3 years ago

@salesforce/eslint-plugin-lightning v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@salesforce/eslint-plugin-lightning

Collection of ESLint rules for Salesforce Lightning platform.

Installation

$ npm install eslint @salesforce/eslint-plugin-lightning --save-dev

Usage

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"
    }
}

Rules

Internationalization rules

Rule IDDescriptionFixable
lightning/no-aura-localization-serviceprevent usage of $A.localizationService
lightning/no-momentprevent usage of moment library
lightning/prefer-i18n-servicesuggest usage of @salesforce/i18n-service over direct calls to Intl

Apex rules

Rule IDDescriptionFixable
lightning/valid-apex-method-invocationenforce invoking Apex methods with the right arguments