UNPKG

@felixgeelhaar/cclint

Version:

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

67 lines 1.78 kB
import type { Rule } from '../domain/Rule.js'; import { ContextFile } from '../domain/ContextFile.js'; import { Violation } from '../domain/Violation.js'; /** * Rule that validates code blocks within CLAUDE.md files * Checks for syntax, completeness, and best practices */ export declare class CodeBlockRule implements Rule { readonly id = "code-blocks"; readonly description = "Validates code blocks for syntax and best practices"; private extractor; private enabledLanguages; private strictMode; constructor(options?: CodeBlockRuleOptions); lint(file: ContextFile): Violation[]; /** * Validate JavaScript/TypeScript code blocks */ private validateJavaScriptTypeScript; /** * Validate Python code blocks */ private validatePython; /** * Validate Go code blocks */ private validateGo; /** * Validate Bash/Shell code blocks */ private validateBash; /** * Validate SQL code blocks */ private validateSQL; /** * Validate JSON code blocks */ private validateJSON; /** * Validate YAML code blocks */ private validateYAML; /** * Check for consistent code style across blocks */ private checkConsistentStyle; /** * Helper: Find the end of a function */ private findFunctionEnd; /** * Helper: Check if a line should have a semicolon */ private shouldHaveSemicolon; /** * Helper: Check if code uses external dependencies */ private usesExternalDependencies; } export interface CodeBlockRuleOptions { /** Languages to validate */ languages?: string[]; /** Enable strict mode checks */ strict?: boolean; } //# sourceMappingURL=CodeBlockRule.d.ts.map