{"id":19932,"library":"eslint-plugin-sf-plugin","title":"eslint-plugin-sf-plugin","description":"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.","status":"active","version":"1.20.33","language":"javascript","source_language":"en","source_url":"https://github.com/salesforcecli/eslint-plugin-sf-plugin","tags":["javascript","force","salesforce","sf","plugins","eslint"],"install":[{"cmd":"npm install eslint-plugin-sf-plugin","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-sf-plugin","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-sf-plugin","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required for Salesforce core utilities, notably in migration rules.","package":"@salesforce/core","optional":false}],"imports":[{"note":"ESLint strips the 'eslint-plugin-' prefix. Use 'sf-plugin' in plugins array.","wrong":"module.exports = { plugins: ['eslint-plugin-sf-plugin'] };","symbol":"plugin","correct":"module.exports = { plugins: ['sf-plugin'] };"},{"note":"Use the full config name 'plugin:sf-plugin/recommended' in extends.","wrong":"extends: ['sf-plugin/recommended']","symbol":"configs.recommended","correct":"extends: ['plugin:sf-plugin/recommended']"},{"note":"Migration config includes recommended rules. Use 'plugin:sf-plugin/migration'.","wrong":"extends: ['eslint-plugin-sf-plugin/migration']","symbol":"configs.migration","correct":"extends: ['plugin:sf-plugin/migration']"}],"quickstart":{"code":"// Install\n// yarn add --dev eslint-plugin-sf-plugin\n\n// .eslintrc.js\nmodule.exports = {\n  extends: ['eslint-config-salesforce-typescript', 'plugin:sf-plugin/recommended'],\n  rules: {\n    'sf-plugin/no-hardcoded-messages': 'error'\n  }\n};\n","lang":"javascript","description":"Shows how to install and configure the plugin with recommended rules in an ESLint config file."},"warnings":[{"fix":"Update Node.js to version 18.0.0 or later.","message":"Version 1.x requires Node >=18.0.0. Older Node versions are not supported.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Apply the migration config ('plugin:sf-plugin/migration') to auto-fix many issues.","message":"The 'sfdxCommand' pattern is deprecated. Use 'sfCommand' instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Ensure your project follows the Salesforce message bundle conventions or disable the rule.","message":"Rules like 'no-hardcoded-messages' may require additional setup (e.g., message bundle files) and can produce false positives if not configured.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run ESLint with --fix and then commit changes after thorough testing.","message":"Using 'plugin:sf-plugin/migration' will auto-fix rule violations, which may cause unexpected code changes. Review changes carefully.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'yarn add --dev eslint-plugin-sf-plugin' or 'npm install --save-dev eslint-plugin-sf-plugin'.","cause":"Plugin not installed as a dev dependency.","error":"Error: Failed to load plugin 'sf-plugin' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-sf-plugin'"},{"fix":"Add '@typescript-eslint/parser' as the parser and ensure 'parserOptions.ecmaVersion' is >= 2020.","cause":"ESLint parser is not set to handle TypeScript or modern JavaScript.","error":"Parsing error: The keyword 'const' is reserved"},{"fix":"Use 'sf-plugin' as the plugin prefix in rules. Example: 'sf-plugin/command-summary': 'error'.","cause":"Incorrect plugin name in rules section (e.g., 'sfplugin' instead of 'sf-plugin').","error":"Definition for rule 'sf-plugin/command-summary' was not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}