MutuallyExclusiveScripts
constMutuallyExclusiveScripts:FilePolicyDefinition<MutuallyExclusiveScriptsConfig|undefined> &object
Defined in: policies/MutuallyExclusiveScripts.ts:51
A policy that validates mutually exclusive script groups in package.json.
Type Declaration
Section titled “Type Declaration”requiresConfig
Section titled “requiresConfig”requiresConfig:
true
Remarks
Section titled “Remarks”Use this policy when you want to enforce that only one script from a group can exist in a package. This is useful for ensuring that packages don’t have conflicting scripts (e.g., both “lint:eslint” and “lint:biome”).
Example
Section titled “Example”import { makePolicy } from "repopo";import { MutuallyExclusiveScripts } from "repopo/policies";
makePolicy(MutuallyExclusiveScripts, { config: { groups: [ ["lint:eslint", "lint:biome"], ["test:jest", "test:vitest"], ],} })