PolicyShape
Defined in: policy.ts:274
Interface describing the shape of a policy definition.
Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”C = void
Type of configuration object used by the policy
Properties
Section titled “Properties”defaultConfig?
Section titled “defaultConfig?”
optionaldefaultConfig?:C
Defined in: policy.ts:307
A default configuration that will be used if none is provided.
description
Section titled “description”description:
string
Defined in: policy.ts:285
A detailed description of the policy and its purpose.
handler
Section titled “handler”handler:
PolicyHandler<C>
Defined in: policy.ts:295
The handler function that checks if a file complies with the policy.
match:
RegExp
Defined in: policy.ts:290
A regular expression that matches files this policy applies to.
name:
string
Defined in: policy.ts:280
The name of the policy; displayed in UI and used in settings.
resolver?
Section titled “resolver?”
optionalresolver?:PolicyResolver<C> |PolicyStandaloneResolver<C>
Defined in: policy.ts:302
An optional resolver function that can automatically fix violations.
Return a PolicyError with fixed: true after a successful fix.
Legacy PolicyFixResult resolvers remain supported.
scope?
Section titled “scope?”
optionalscope?:"file"
Defined in: policy.ts:276
File scope is the default for existing policies.