UNPKG

@felixgeelhaar/cclint

Version:

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

70 lines 2.21 kB
import type { Rule } from './Rule.js'; import type { ContextFile } from './ContextFile.js'; import type { Violation } from './Violation.js'; import type { Fix } from './AutoFix.js'; /** * Abstract base class for custom rules * Provides a foundation for implementing custom validation logic */ export declare abstract class CustomRule implements Rule { readonly id: string; readonly description: string; readonly category: string | undefined; readonly version: string | undefined; constructor(id: string, description: string, options?: { category?: string; version?: string; }); /** * Main linting method that calls the internal validation * This provides a consistent interface while allowing custom implementation */ lint(file: ContextFile): Violation[]; /** * Internal validation method to be implemented by custom rules * @param file The context file to validate * @returns Array of violations found */ protected abstract validateInternal(file: ContextFile): Violation[]; /** * Generate auto-fixes for violations created by this rule * @param violations Array of violations to fix * @param content Original file content * @returns Array of fixes to apply */ abstract generateFixes(violations: Violation[], content: string): Fix[]; /** * Validate rule configuration options * Override this method to add custom configuration validation */ validateOptions(_options: Record<string, unknown>): boolean; /** * Get rule metadata for documentation and tooling */ getMetadata(): { id: string; description: string; category: string | undefined; version: string | undefined; hasAutoFix: boolean; }; } /** * Interface for plugin exports * Plugins must export an object conforming to this interface */ export interface Plugin { name: string; version: string; description?: string; author?: string; rules: CustomRule[]; dependencies?: string[]; } /** * Type for plugin module exports */ export interface PluginModule { default: Plugin; } //# sourceMappingURL=CustomRule.d.ts.map