JSPM

@guardrail-ai/fixer

0.2.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 17
  • Score
    100M100P100Q54572F
  • License MIT

AST-based auto-fix engine for Guardrail

Package Exports

  • @guardrail-ai/fixer
  • @guardrail-ai/fixer/dist/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@guardrail-ai/fixer) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

@guardrail-ai/fixer

AST-based auto-fix engine for Guardrail. Applies fixes from rule violations and outputs unified diffs.

Install

npm install @guardrail-ai/fixer

Usage

import { FixerEngine } from '@guardrail-ai/fixer';

const fixer = new FixerEngine();

// Dry run — returns diff without writing
const result = await fixer.applyFixes(filePath, violations, false);
console.log(result.diff);
console.log(`${result.applied} fixes applied`);

// Write fixes to disk
await fixer.applyFixes(filePath, violations, true);

How it works

  1. Sorts fixes bottom-to-top to preserve line numbers
  2. Applies line-based replacements from violation fix suggestions
  3. Generates unified diffs via the diff package
  4. Optionally writes the fixed file to disk

License

MIT