folder-validator
Version:
A powerful tool to validate and maintain consistent folder structures across your projects
31 lines (27 loc) • 909 B
TypeScript
interface FolderDefinition {
name: string;
required?: boolean;
children?: FolderDefinition[];
description?: string;
}
type ValidationOptions = {
strict?: boolean;
allowUnknown?: boolean;
ignoreCase?: boolean;
};
type ValidationResult = {
isValid: boolean;
errors: string[];
warnings: string[];
};
/**
* Define a folder structure configuration
* @param folders Array of folder definitions
* @returns Processed folder configuration
*/
declare const defineFolders: (folders: FolderDefinition[]) => FolderDefinition[];
/**
* Validates the folder structure against allowed folders
*/
declare const validateFolderStructure: (rootPath: string, configOrPath: string | FolderDefinition[], options?: ValidationOptions) => Promise<ValidationResult>;
export { type FolderDefinition, type ValidationOptions, type ValidationResult, defineFolders, validateFolderStructure };