smart-renamer
Version:
🚀 Intelligent file and code naming suggestions based on project-specific naming conventions. Interactive CLI tool with AST-based code analysis for variables, functions, components, and more.
40 lines • 1.18 kB
TypeScript
export interface CodeIdentifier {
name: string;
type: 'variable' | 'function' | 'class' | 'constant' | 'interface' | 'type' | 'enum';
line: number;
column: number;
filePath: string;
scope: 'global' | 'local' | 'class' | 'function';
isExported: boolean;
isReactComponent?: boolean;
}
export interface CodeAnalysisResult {
identifiers: CodeIdentifier[];
conventions: {
variables: {
[convention: string]: number;
};
functions: {
[convention: string]: number;
};
classes: {
[convention: string]: number;
};
constants: {
[convention: string]: number;
};
};
totalIdentifiers: number;
consistencyScore: number;
}
export declare class ASTAnalyzer {
private detectNamingConvention;
private isReactComponent;
private isConstant;
private extractIdentifiersFromNode;
private checkIfExported;
private extractExportedIdentifiers;
analyzeFile(filePath: string): CodeIdentifier[];
analyzeProject(rootPath: string, patterns?: string[]): CodeAnalysisResult;
}
//# sourceMappingURL=ast-analyzer.d.ts.map