UNPKG

@felixgeelhaar/cclint

Version:

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

33 lines 965 B
import { ContextFile } from './ContextFile.js'; import { LintingResult } from './LintingResult.js'; export class RulesEngine { _rules = new Map(); constructor(rules) { for (const rule of rules) { if (this._rules.has(rule.id)) { throw new Error(`Duplicate rule ID: ${rule.id}`); } this._rules.set(rule.id, rule); } } get rules() { return Array.from(this._rules.values()); } lint(file) { const result = new LintingResult(file); for (const rule of this._rules.values()) { const violations = rule.lint(file); for (const violation of violations) { result.addViolation(violation); } } return result; } getRuleById(ruleId) { return this._rules.get(ruleId); } hasRule(ruleId) { return this._rules.has(ruleId); } } //# sourceMappingURL=RulesEngine.js.map