/eslint-config-sf-common

ESLint rules for Salesforce projects.

Primary LanguageJavaScriptMIT LicenseMIT

eslint-config-sf-common

npm version

This package provides a complete set of ESLint rules for Salesforce projects with Aura and LWC support.

The package benefits from rules and configurations provided by the following packages:

Usage

Example .eslintrc.json configuration file can look like this:

{
  "overrides": [
    {
      "extends": [
        // https://github.com/forcedotcom/eslint-plugin-aura
        "plugin:@salesforce/eslint-plugin-aura/recommended",
        "eslint-config-sf-common"
      ],
      "files": [
        "src/**/aura/**"
      ],
      "plugins": [
        "@salesforce/eslint-plugin-aura"
      ],
      // override rules which are not applicable to Aura
      "rules": {
        "no-unused-expressions": "off",
        "object-shorthand": "off"
      }
    },
    {
      "extends": [
        // https://github.com/salesforce/eslint-config-lwc
        "@salesforce/eslint-config-lwc/recommended",
        "eslint-config-sf-common"
      ],
      "files": [
        "src/**/lwc/**"
      ]
    }
  ]
}

This project is not an official Salesforce product.