UNPKG

@felixgeelhaar/cclint

Version:

A comprehensive linter for CLAUDE.md files with multi-language code block validation

30 lines 950 B
import { Location } from './Location.js'; import { Severity } from './Severity.js'; export class Violation { ruleId; message; severity; location; constructor(ruleId, message, severity, location) { if (ruleId.trim() === '') { throw new Error('Rule ID cannot be empty'); } if (message.trim() === '') { throw new Error('Message cannot be empty'); } this.ruleId = ruleId; this.message = message; this.severity = severity; this.location = location; } toString() { return `${this.severity.toString()}: ${this.message} at ${this.location.toString()} [${this.ruleId}]`; } equals(other) { return (this.ruleId === other.ruleId && this.message === other.message && this.severity === other.severity && this.location.equals(other.location)); } } //# sourceMappingURL=Violation.js.map