Skip to content

no-redundant-publishConfig

💼 This rule is enabled in the following configs: ✅ recommended, 📦 recommended-publishable.

💡 This rule is manually fixable by editor suggestions.

This rule warns when publishConfig.access is used in unscoped packages, as it has no effect.

Per npm documentation, unscoped packages (package names without @) are always public and cannot be made private.

Using publishConfig.access in these packages is redundant since the property only affects scoped packages.

The rule will report when unscoped packages have publishConfig.access defined. It will ignore the property for scoped packages (e.g. @org/name).

{
"name": "my-package",
"publishConfig": { "access": "public" }
}
{
"name": "my-package",
"publishConfig": { "access": "restricted" }
}
{
"name": "my-package",
"publishConfig": {
"access": "public",
"registry": "https://example.com"
}
}

Disable this rule if you:

  • Want to keep the publishConfig.access field as documentation even though it has no effect
  • Are planning to convert your unscoped package to a scoped package in the future