UNPKG

@felixgeelhaar/cclint

Version:

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

27 lines 989 B
import { ContextFile } from '../domain/ContextFile.js'; import { Violation } from '../domain/Violation.js'; import { Location } from '../domain/Location.js'; import { Severity } from '../domain/Severity.js'; export class StructureRule { id = 'structure'; description; requiredSections; constructor(requiredSections = [ 'Project Overview', 'Development Commands', 'Architecture', ]) { this.requiredSections = requiredSections; this.description = `File must contain required sections: ${requiredSections.join(', ')}`; } lint(file) { const violations = []; for (const requiredSection of this.requiredSections) { if (!file.hasSection(requiredSection)) { violations.push(new Violation(this.id, `Missing required section: "${requiredSection}"`, Severity.ERROR, new Location(1, 1))); } } return violations; } } //# sourceMappingURL=StructureRule.js.map