ESLint plugin providing rules for Salesforce CLI plugins development. Current stable version is 1.20.33, with frequent patch releases following @salesforce/core dependencies. It offers recommended and migration configurations to enforce best practices like command summaries, flag naming conventions, and hardcoded message detection. Differentiates by integrating with Salesforce toolchain and easing migration from sfdxCommand to sfCommand.
npm install eslint-plugin-sf-pluginVerified import paths — ran on the pinned version, not inferred.
Shows how to install and configure the plugin with recommended rules in an ESLint config file.
Update Node.js to version 18.0.0 or later.
Apply the migration config ('plugin:sf-plugin/migration') to auto-fix many issues.Ensure your project follows the Salesforce message bundle conventions or disable the rule.
Run ESLint with --fix and then commit changes after thorough testing.
Run 'yarn add --dev eslint-plugin-sf-plugin' or 'npm install --save-dev eslint-plugin-sf-plugin'.
Add '@typescript-eslint/parser' as the parser and ensure 'parserOptions.ecmaVersion' is >= 2020.
Use 'sf-plugin' as the plugin prefix in rules. Example: 'sf-plugin/command-summary': 'error'.