Policy
Defined in: policy.ts:319
Abstract base class for creating policies with object-based construction.
Remarks
Section titled “Remarks”This class accepts a PolicyShape object in its constructor, making it easier to add new optional properties in the future without breaking changes.
Type Parameters
Section titled “Type Parameters”C = void
Implements
Section titled “Implements”PolicyShape<C>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Policy<
C>(definition):Policy<C>
Defined in: policy.ts:341
Creates a policy from its definition.
Parameters
Section titled “Parameters”definition
Section titled “definition”PolicyShape<C>
File matching, handler, and optional defaults and resolver.
Returns
Section titled “Returns”Policy<C>
Properties
Section titled “Properties”defaultConfig?
Section titled “defaultConfig?”
readonlyoptionaldefaultConfig?:C
Defined in: policy.ts:329
Configuration used when no instance configuration is supplied.
Implementation of
Section titled “Implementation of”description
Section titled “description”
readonlydescription:string
Defined in: policy.ts:323
Description of the policy’s purpose.
Implementation of
Section titled “Implementation of”handler
Section titled “handler”
readonlyhandler:PolicyHandler<C>
Defined in: policy.ts:327
Checks each matching file and optionally applies fixes.
Implementation of
Section titled “Implementation of”
readonlymatch:RegExp
Defined in: policy.ts:325
Regular expression matched against repo-relative file paths.
Implementation of
Section titled “Implementation of”
readonlyname:string
Defined in: policy.ts:321
Policy name used for display and configuration.
Implementation of
Section titled “Implementation of”resolver?
Section titled “resolver?”
readonlyoptionalresolver?:PolicyResolver<C> |PolicyStandaloneResolver<C>
Defined in: policy.ts:331
Optional standalone fixer called for violations not handled by the handler.