UNPKG

@felixgeelhaar/cclint

Version:

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

25 lines 935 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 FileSizeRule { id = 'file-size'; description; maxSize; constructor(maxSize = 10000) { if (maxSize <= 0) { throw new Error('Max size must be positive'); } this.maxSize = maxSize; this.description = `File size should not exceed ${maxSize} characters`; } lint(file) { const violations = []; const size = file.getCharacterCount(); if (size > this.maxSize) { violations.push(new Violation(this.id, `File size (${size} characters) exceeds maximum allowed size (${this.maxSize} characters)`, Severity.WARNING, new Location(1, 1))); } return violations; } } //# sourceMappingURL=FileSizeRule.js.map