ConfiguredFilePolicy
Defined in: policy.ts:366
A policy instance with configuration and exclusion settings applied.
Extends
Section titled “Extends”PolicyShape<C>
Type Parameters
Section titled “Type Parameters”C = void
Type of configuration object used by the policy
Properties
Section titled “Properties”config?
Section titled “config?”
optionalconfig?:C
Defined in: policy.ts:377
The configuration applied to this policy instance.
defaultConfig?
Section titled “defaultConfig?”
optionaldefaultConfig?:C
Defined in: policy.ts:307
A default configuration that will be used if none is provided.
Inherited from
Section titled “Inherited from”description
Section titled “description”description:
string
Defined in: policy.ts:285
A detailed description of the policy and its purpose.
Inherited from
Section titled “Inherited from”exclude?
Section titled “exclude?”
optionalexclude?: (string|RegExp)[]
Defined in: policy.ts:384
File paths matching these patterns will be excluded from this policy. Strings are case-insensitive regular expressions; RegExp values retain their flags. Paths are relative to the repository root.
excludeFiles?
Section titled “excludeFiles?”
optionalexcludeFiles?: (string|RegExp)[]
Defined in: policy.ts:390
File paths matching these patterns will be excluded from this policy.
Legacy alias for exclude.
handler
Section titled “handler”handler:
PolicyHandler<C>
Defined in: policy.ts:295
The handler function that checks if a file complies with the policy.
Inherited from
Section titled “Inherited from”instanceId?
Section titled “instanceId?”
optionalinstanceId?:string
Defined in: policy.ts:372
An optional stable identifier for this configured policy instance.
This is required when the same policy definition is configured more than once.
match:
RegExp
Defined in: policy.ts:290
A regular expression that matches files this policy applies to.
Inherited from
Section titled “Inherited from”name:
string
Defined in: policy.ts:280
The name of the policy; displayed in UI and used in settings.
Inherited from
Section titled “Inherited from”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.
Inherited from
Section titled “Inherited from”scope?
Section titled “scope?”
optionalscope?:"file"
Defined in: policy.ts:276
File scope is the default for existing policies.