Skip to content
Fallow home
All docs pages

Docs home

Policy violations

What a policy-violation finding of fallow dead-code means, why it matters and how to fix it.

What it reports

Usage violates a configured rule-pack policy.

Architecture explains how fallow finds it.

Why it matters

A call, import, export, catalogue-derived effect, or graph-resolved GDP proof producer violates a configured rule pack (the rulePacks config key). Packs are pure declarative data. Call rules match calls and new expressions, on written plus import-resolved canonical callees. Effect rules match calls only. Import rules match the raw specifier. GDP rules trace @gdp-ts/core proof producers through unambiguous re-exports and restrict which files may create proof factories, optionally by exact static proof kind. This is syntactic ownership analysis, not a runtime authorization guarantee. Follow the rule's message, move a producer into an allowed file, scope the rule with files/exclude globs, or adjust its severity.

Example

src/app.ts imports moment while a rule pack bans the moment specifier with the message 'Use date-fns.'

Fix

Follow the rule's message to replace banned usage or remove a banned export. For a GDP proof producer, move proof factory creation into an allowed file, or correct the rule's allowedFiles and optional proofKinds if the ownership policy was wrong. For a banned-import rule with allowNames, import a listed name by name. To waive one rule, use // fallow-ignore-next-line policy-violation:<pack>/<rule-id> or the file-level form. Use bare policy-violation only when you intend to suppress every rule-pack finding at that scope.

Facts

FactValue
Issue typepolicy-violation
Rule id in SARIF outputfallow/policy-violation
Commandfallow dead-code
Default severitywarn
Config key in rulespolicy-violation
Filter option--policy-violations
Suppression comment// fallow-ignore-next-line policy-violation
Fixable with fallow fixNo
Opt-inNo

Note. Requires a configured rule pack (rulePacks config).

When to keep the code

  • When a rule must not apply to some folders, limit the rule with its files and exclude globs.
  • To keep one finding, suppress only its rule: // fallow-ignore-next-line policy-violation:<pack>/<rule-id>. A bare policy-violation token hides each rule-pack finding at that place.