@samiyev/guardian
Version:
Research-backed code quality guardian for AI-assisted development. Detects hardcodes, secrets, circular deps, framework leaks, entity exposure, and 9 architecture violations. Enforces Clean Architecture/DDD principles. Works with GitHub Copilot, Cursor, W
109 lines • 4.93 kB
TypeScript
/**
* Naming Convention Detector Constants
*
* Following Clean Code principles:
* - No magic strings
* - Single source of truth
* - Easy to maintain
*/
/**
* Files to exclude from naming convention checks
*/
export declare const EXCLUDED_FILES: readonly ["index.ts", "BaseUseCase.ts", "BaseMapper.ts", "IBaseRepository.ts", "BaseEntity.ts", "ValueObject.ts", "BaseRepository.ts", "BaseError.ts", "DomainEvent.ts", "Suggestions.ts"];
/**
* File suffixes for pattern matching
*/
export declare const FILE_SUFFIXES: {
readonly SERVICE: "Service.ts";
readonly DTO: "Dto.ts";
readonly REQUEST: "Request.ts";
readonly RESPONSE: "Response.ts";
readonly MAPPER: "Mapper.ts";
readonly CONTROLLER: "Controller.ts";
readonly REPOSITORY: "Repository.ts";
readonly ADAPTER: "Adapter.ts";
};
/**
* Path patterns for detection
*/
export declare const PATH_PATTERNS: {
readonly USE_CASES: "/use-cases/";
readonly USE_CASES_ALT: "/usecases/";
};
/**
* Common words for pattern matching
*/
export declare const PATTERN_WORDS: {
readonly REPOSITORY: "Repository";
readonly I_PREFIX: "I";
};
/**
* Error messages for naming violations
*/
export declare const NAMING_ERROR_MESSAGES: {
readonly DOMAIN_FORBIDDEN: "Domain layer should not contain DTOs, Controllers, or Request/Response objects";
readonly USE_PASCAL_CASE: "Use PascalCase noun (e.g., User.ts, Order.ts, Email.ts)";
readonly USE_DTO_SUFFIX: "Use *Dto, *Request, or *Response suffix (e.g., UserResponseDto.ts)";
readonly USE_VERB_NOUN: "Use verb + noun in PascalCase (e.g., CreateUser.ts, UpdateProfile.ts)";
readonly USE_CASE_START_VERB: "Use cases should start with a verb";
readonly DOMAIN_SERVICE_PASCAL_CASE: "Domain services must be PascalCase ending with 'Service'";
readonly DOMAIN_ENTITY_PASCAL_CASE: "Domain entities must be PascalCase nouns";
readonly DTO_PASCAL_CASE: "DTOs must be PascalCase ending with 'Dto', 'Request', or 'Response'";
readonly MAPPER_PASCAL_CASE: "Mappers must be PascalCase ending with 'Mapper'";
readonly USE_CASE_VERB_NOUN: "Use cases must be PascalCase Verb+Noun (e.g., CreateUser)";
readonly CONTROLLER_PASCAL_CASE: "Controllers must be PascalCase ending with 'Controller'";
readonly REPOSITORY_IMPL_PASCAL_CASE: "Repository implementations must be PascalCase ending with 'Repository'";
readonly SERVICE_ADAPTER_PASCAL_CASE: "Services/Adapters must be PascalCase ending with 'Service' or 'Adapter'";
readonly FUNCTION_CAMEL_CASE: "Functions and methods must be camelCase";
readonly USE_CAMEL_CASE_FUNCTION: "Use camelCase for function names (e.g., getUserById, createOrder)";
readonly INTERFACE_PASCAL_CASE: "Interfaces must be PascalCase";
readonly USE_PASCAL_CASE_INTERFACE: "Use PascalCase for interface names";
readonly REPOSITORY_INTERFACE_I_PREFIX: "Domain repository interfaces must start with 'I' (e.g., IUserRepository)";
readonly REPOSITORY_INTERFACE_PATTERN: "Repository interfaces must be I + PascalCase + Repository";
readonly CONSTANT_UPPER_SNAKE_CASE: "Exported constants must be UPPER_SNAKE_CASE";
readonly USE_UPPER_SNAKE_CASE_CONSTANT: "Use UPPER_SNAKE_CASE for constant names (e.g., MAX_RETRIES, API_URL)";
readonly VARIABLE_CAMEL_CASE: "Variables must be camelCase";
readonly USE_CAMEL_CASE_VARIABLE: "Use camelCase for variable names (e.g., userId, orderList)";
};
/**
* DDD folder names for aggregate boundary detection
*/
export declare const DDD_FOLDER_NAMES: {
readonly ENTITIES: "entities";
readonly AGGREGATES: "aggregates";
readonly VALUE_OBJECTS: "value-objects";
readonly VO: "vo";
readonly EVENTS: "events";
readonly DOMAIN_EVENTS: "domain-events";
readonly REPOSITORIES: "repositories";
readonly SERVICES: "services";
readonly SPECIFICATIONS: "specifications";
readonly DOMAIN: "domain";
readonly CONSTANTS: "constants";
readonly SHARED: "shared";
readonly FACTORIES: "factories";
readonly PORTS: "ports";
readonly INTERFACES: "interfaces";
readonly ERRORS: "errors";
readonly EXCEPTIONS: "exceptions";
};
/**
* Repository method suggestions for domain language
*/
export declare const REPOSITORY_METHOD_SUGGESTIONS: {
readonly SEARCH: "search";
readonly FIND_BY_PROPERTY: "findBy[Property]";
readonly GET_ENTITY: "get[Entity]";
readonly CREATE: "create";
readonly ADD_ENTITY: "add[Entity]";
readonly STORE_ENTITY: "store[Entity]";
readonly UPDATE: "update";
readonly MODIFY_ENTITY: "modify[Entity]";
readonly SAVE: "save";
readonly DELETE: "delete";
readonly REMOVE_BY_PROPERTY: "removeBy[Property]";
readonly FIND_ALL: "findAll";
readonly LIST_ALL: "listAll";
readonly DEFAULT_SUGGESTION: "Use domain-specific names like: findBy[Property], save, create, delete, update, add[Entity]";
};
//# sourceMappingURL=detectorPatterns.d.ts.map