eslint-plugin-sfdx
Custom rules for Salesforce DXInstallation
You'll first need to install ESLint:$ npm i eslint --save-dev
Next, install
eslint-plugin-sfdx
:$ npm install eslint-plugin-sfdx --save-dev
Note: If you installed ESLint globally (using the
-g
flag) then you must also install eslint-plugin-sfdx
globally.Usage
Addsfdx
to the plugins section of your .eslintrc
configuration file. You can omit the eslint-plugin-
prefix:{
"plugins": [
"sfdx"
]
}
Then configure the rules you want to use under the rules section.
{
"rules": {
"sfdx/ecma-intrinsics": 1,
"sfdx/secure-document": 1,
"sfdx/aura-api": 1,
"sfdx/secure-window": 1
}
}