{"id":19571,"library":"eslint-config-salesforce-license","title":"Salesforce ESLint License Config","description":"An ESLint configuration package from Salesforce that enforces a license header comment on all source files. Current stable version is 1.0.2. It is a small, single-purpose config that wraps the eslint-plugin-header plugin to ensure every JavaScript/TypeScript file in a Salesforce project starts with the required Salesforce copyright and license notice. Key differentiators: it is the official Salesforce tooling, tightly integrated with @salesforce/dev-scripts, and provides a plug-and-play setup for license compliance across Salesforce DX projects. Release cadence is sporadic, driven by license year updates or CI changes.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/forcedotcom/eslint-config-salesforce-license","tags":["javascript","Salesforce","eslint"],"install":[{"cmd":"npm install eslint-config-salesforce-license","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-salesforce-license","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-salesforce-license","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required by all ESLint config packages; must be installed alongside","package":"eslint","optional":false},{"reason":"the plugin that actually enforces the license header; this config extends it","package":"eslint-plugin-header","optional":false}],"imports":[{"note":"In .eslintrc files, use the full package name as shown. Abbreviated names may not resolve.","wrong":"extends: ['salesforce-license']","symbol":"extends","correct":"extends: ['eslint-config-salesforce-license']"},{"note":"This package ships only CJS; .eslintrc.mjs must use module.exports or convert to CommonJS.","wrong":"export default { extends: ['eslint-config-salesforce-license'] }","symbol":"module.exports","correct":"module.exports = { extends: ['eslint-config-salesforce-license'] }"},{"note":"The config already includes the 'header' plugin; you should not add it manually.","wrong":"plugins: ['eslint-plugin-header'] or omitting the plugin entirely","symbol":"plugins","correct":"plugins: ['header'] combined with extends: ['eslint-config-salesforce-license']"}],"quickstart":{"code":"// Install dependencies\nnpm install --save-dev eslint eslint-config-salesforce-license eslint-plugin-header\n\n// .eslintrc.js\nmodule.exports = {\n  extends: ['eslint-config-salesforce-license'],\n  // Optionally disable header rule for test files or specific directories\n  overrides: [\n    {\n      files: ['**/*.test.ts', '**/__tests__/**'],\n      rules: {\n        'header/header': 'off',\n      },\n    },\n  ],\n};\n\n// Then run ESLint: npx eslint src/","lang":"javascript","description":"Shows installation and basic configuration of the Salesforce license ESLint config, including a common override to skip license headers in test files."},"warnings":[{"fix":"Make sure your source files start with the exact license comment. Check the config source at https://github.com/forcedotcom/eslint-config-salesforce-license","message":"The 'header/header' rule will fail if the license header does not exactly match the template defined by this config.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Update to the latest version: npm install eslint-config-salesforce-license@latest","message":"Version 0.x used an older license text; upgrade to 1.x for the current year's license.","severity":"deprecated","affected_versions":"<1.0.0"},{"fix":"Run: npm install --save-dev eslint-plugin-header","message":"The eslint-plugin-header must be installed separately; it is not bundled and will not be installed automatically.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"Combine with eslint-config-salesforce-typescript for full Salesforce linting: extends: ['eslint-config-salesforce-license', 'eslint-config-salesforce-typescript']","message":"This config only checks for the license header; it does not include other Salesforce-specific rules (e.g., naming conventions).","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"npm install --save-dev eslint-plugin-header","cause":"eslint-plugin-header is a missing required dependency","error":"Error: Failed to load plugin 'header' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-header'"},{"fix":"npm install --save-dev eslint-config-salesforce-license","cause":"The package is not installed or not found in node_modules","error":"Error: Failed to load config 'eslint-config-salesforce-license' to extend from."},{"fix":"Use export default { extends: ['eslint-config-salesforce-license'] } or rename to .eslintrc.cjs","cause":"Using .eslintrc.mjs with CJS-style module.exports","error":"ReferenceError: module is not defined in ES module scope"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}