@felixgeelhaar/cclint
Version:
Catch CLAUDE.md drift before Claude misbehaves. Lints CLAUDE.md, skills, subagents, and hooks for Claude Code projects.
47 lines • 1.77 kB
TypeScript
import type { Rule } from '../domain/Rule.js';
import { ContextFile } from '../domain/ContextFile.js';
import { Violation } from '../domain/Violation.js';
/**
* Rule that validates CLAUDE.md import syntax
*
* @remarks
* Validates the @path/to/file import syntax introduced by Anthropic.
* - Imports should not appear in code blocks or code spans
* - Warns about potential circular dependencies
* - Validates path formats (relative, absolute, home directory)
*
* @see {@link https://docs.claude.com/en/docs/claude-code/memory#claude-md-imports | CLAUDE.md imports documentation}
*
* @category Rules
*/
export declare class ImportSyntaxRule implements Rule {
readonly id = "import-syntax";
readonly description = "Validates CLAUDE.md import syntax (@path/to/file)";
private readonly maxDepth;
constructor(maxDepth?: number);
appliesTo(file: ContextFile): boolean;
lint(file: ContextFile): Violation[];
/**
* Find all import patterns in a line
*/
private findImports;
/**
* Check if import is inside a code span (backticks)
*/
private isInCodeSpan;
/**
* Validate import path format and provide helpful suggestions.
*
* The findImports regex char class ([\w\-~/.]+) cannot capture `@`,
* `\`, or whitespace, so package-name, Windows-backslash, and space
* checks are unreachable here — they belong upstream in findImports
* if those signals are ever needed. We keep the path-shape checks
* for documentation value and to guard the `//` double-slash edge.
*/
private validateImportPath;
/**
* Check for patterns and potential issues across all imports
*/
private checkImportPatterns;
}
//# sourceMappingURL=ImportSyntaxRule.d.ts.map