Registry / devops / eslint-config-salesforce-license

eslint-config-salesforce-license

JSON →
library1.0.2jsnpmunverified

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.

npm install eslint-config-salesforce-license
INSTALL
IMPORT
SIG · ESLINT-CONFIG-SALE
E
eslint-config-salesforce-license
devopsjavascriptv1.0.2
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

extends
extends: ['eslint-config-salesforce-license']
extends: ['salesforce-license']
In .eslintrc files, use the full package name as shown. Abbreviated names may not resolve.
module.exports
module.exports = { extends: ['eslint-config-salesforce-license'] }
export default { extends: ['eslint-config-salesforce-license'] }
This package ships only CJS; .eslintrc.mjs must use module.exports or convert to CommonJS.
plugins
plugins: ['header'] combined with extends: ['eslint-config-salesforce-license']
plugins: ['eslint-plugin-header'] or omitting the plugin entirely
The config already includes the 'header' plugin; you should not add it manually.

Shows installation and basic configuration of the Salesforce license ESLint config, including a common override to skip license headers in test files.

// Install dependencies npm install --save-dev eslint eslint-config-salesforce-license eslint-plugin-header // .eslintrc.js module.exports = { extends: ['eslint-config-salesforce-license'], // Optionally disable header rule for test files or specific directories overrides: [ { files: ['**/*.test.ts', '**/__tests__/**'], rules: { 'header/header': 'off', }, }, ], }; // Then run ESLint: npx eslint src/
Debug
Known issues
gotchaThe 'header/header' rule will fail if the license header does not exactly match the template defined by this config.
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
affects: >=0.1.0
deprecatedVersion 0.x used an older license text; upgrade to 1.x for the current year's license.
fix
Update to the latest version: npm install eslint-config-salesforce-license@latest
affects: <1.0.0
gotchaThe eslint-plugin-header must be installed separately; it is not bundled and will not be installed automatically.
fix
Run: npm install --save-dev eslint-plugin-header
affects: >=0.1.0
gotchaThis config only checks for the license header; it does not include other Salesforce-specific rules (e.g., naming conventions).
fix
Combine with eslint-config-salesforce-typescript for full Salesforce linting: extends: ['eslint-config-salesforce-license', 'eslint-config-salesforce-typescript']
affects: >=0.1.0
Errors
Common errors & fixes
Error: Failed to load plugin 'header' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-header'
eslint-plugin-header is a missing required dependency
fix
npm install --save-dev eslint-plugin-header
Error: Failed to load config 'eslint-config-salesforce-license' to extend from.
The package is not installed or not found in node_modules
fix
npm install --save-dev eslint-config-salesforce-license
ReferenceError: module is not defined in ES module scope
Using .eslintrc.mjs with CJS-style module.exports
fix
Use export default { extends: ['eslint-config-salesforce-license'] } or rename to .eslintrc.cjs
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required by all ESLint config packages; must be installed alongside
eslint-plugin-headerrequiredthe plugin that actually enforces the license header; this config extends it
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-config-salesforce-license — npm install eslint-config-salesforce-license · libregistry