@felixgeelhaar/cclint
Version:
A comprehensive linter for CLAUDE.md files with multi-language code block validation
76 lines • 2.28 kB
TypeScript
import type { Rule } from '../domain/Rule.js';
/**
* Central registry for all rules (built-in and custom)
* Manages rule registration, lookup, and lifecycle
*/
export declare class RuleRegistry {
private rules;
private plugins;
/**
* Register a custom rule
* @param rule The rule to register
* @param pluginName Optional plugin name that provides this rule
*/
registerRule(rule: Rule, pluginName?: string): void;
/**
* Get a rule by its ID
* @param ruleId The ID of the rule to retrieve
* @returns The rule or undefined if not found
*/
getRule(ruleId: string): Rule | undefined;
/**
* Check if a rule is registered
* @param ruleId The ID of the rule to check
* @returns True if the rule is registered
*/
hasRule(ruleId: string): boolean;
/**
* Get all registered rules
* @returns Array of all registered rules
*/
getAllRules(): Rule[];
/**
* Get rules filtered by category
* @param category The category to filter by
* @returns Array of rules in the specified category
*/
getRulesByCategory(category: string): Rule[];
/**
* Get rules provided by a specific plugin
* @param pluginName The name of the plugin
* @returns Array of rules from the specified plugin
*/
getRulesByPlugin(pluginName: string): Rule[];
/**
* Unregister a rule
* @param ruleId The ID of the rule to unregister
*/
unregisterRule(ruleId: string): void;
/**
* Unregister all rules from a plugin
* @param pluginName The name of the plugin
*/
unregisterPlugin(pluginName: string): void;
/**
* Get plugin name for a rule
* @param ruleId The ID of the rule
* @returns The plugin name or undefined if it's a built-in rule
*/
getPluginForRule(ruleId: string): string | undefined;
/**
* Get registry statistics
* @returns Object containing registry statistics
*/
getStats(): {
totalRules: number;
customRules: number;
builtInRules: number;
pluginCount: number;
};
/**
* Clear all registered rules
* Used primarily for testing
*/
clear(): void;
}
//# sourceMappingURL=RuleRegistry.d.ts.map