Skip to content

Schema Reference

Schema Reference

This page documents every field recognised by ConfigurationSchema. The schema is defined in src/configuration/schemas.ts and validated via Zod at runtime.


Top-level fields

FieldTypeRequiredDescription
namestring (min 1)YesHuman-readable filter list name
descriptionstringNoDescription of the list’s purpose
homepagestring (url)NoHomepage URL for the list
licensestringNoSPDX license identifier (e.g. GPL-3.0, MIT)
versionstringNoSemver version string (e.g. 1.0.0)
sourcesSource[]YesNon-empty array of input source definitions
transformationsTransformationType[]NoOrdered list of transformation steps
exclusionsstring[]NoRules to exclude from the compiled output
exclusions_sourcesstring[]NoFile paths / URLs containing exclusion rules
inclusionsstring[]NoRules to always include regardless of exclusions
inclusions_sourcesstring[]NoFile paths / URLs containing inclusion rules

Source object

Each entry in sources must be an object:

FieldTypeRequiredDescription
sourcestringYesURL or file path of the input rule list
type"hosts" | "adblock"NoFormat of the source (optional; defaults inferred at compile time)
namestringNoDisplay name for this source
homepagestring (url)NoHomepage URL for this source

TransformationType enum

ValueDescription
RemoveCommentsStrip comment lines
CompressRemove redundant rules subsumed by wider rules
RemoveModifiersStrip cosmetic / option modifiers from rules
ValidateDrop rules failing format validation
ValidateAllowIpValidate rules, allowing IP addresses
DeduplicateRemove duplicate rules
InvertAllowInvert allowlist rules to blocklist rules
RemoveEmptyLinesRemove empty lines
TrimLinesTrim whitespace from each rule line
InsertFinalNewLineEnsure file ends with a newline
ConvertToAsciiConvert non-ASCII domain names to Punycode (ASCII)
ConflictDetectionReport conflicting allow/block rules
RuleOptimizerMerge and simplify rules for smaller output

Note: Combine transformations as an ordered array; each step is applied in sequence.


System limits

These limits are enforced by ConfigurationManager regardless of schema validity:

LimitDefaultConfig key
Maximum sources100VALIDATION_DEFAULTS.MAX_SOURCES
Maximum exclusion rules10,000VALIDATION_DEFAULTS.MAX_EXCLUSIONS

Arrays exceeding these limits are silently truncated before Zod validation. Set enforceSourceLimit: false / enforceExclusionLimit: false in manager options to opt out (not recommended for production).