PackageAllowedScopesConfig
Defined in: policies/PackageAllowedScopes.ts:24
Configuration for the PackageAllowedScopes policy.
This policy ensures packages in a monorepo use only approved scopes or package names. This prevents accidental introduction of new scopes and ensures naming consistency.
Example
Section titled “Example”const config: PackageAllowedScopesConfig = { // Only packages in these scopes are allowed allowedScopes: ["@myorg", "@internal", "@experimental"], // These specific unscoped packages are also allowed unscopedPackages: ["my-legacy-tool", "special-package"],};Properties
Section titled “Properties”allowedScopes?
Section titled “allowedScopes?”
optionalallowedScopes?:string[]
Defined in: policies/PackageAllowedScopes.ts:41
A list of npm scopes that are allowed for packages in this repository.
Scopes should start with @ (e.g., @myorg). A package like @myorg/foo
would match the scope @myorg.
Remarks
Section titled “Remarks”If a package’s scope is not in this list and the package is not in
unscopedPackages, the policy will fail.
Example
Section titled “Example”allowedScopes: ["@myorg", "@myorg-tools", "@myorg-internal"]unscopedPackages?
Section titled “unscopedPackages?”
optionalunscopedPackages?:string[]
Defined in: policies/PackageAllowedScopes.ts:57
A list of unscoped package names that are explicitly allowed.
Use this for legacy packages or special cases where an unscoped name is needed.
Remarks
Section titled “Remarks”Unscoped packages not in this list will cause the policy to fail.
Example
Section titled “Example”unscopedPackages: ["my-legacy-tool", "special-package"]