Platform
    • Naming & Linter Rules
    • Styling Standards
    • Theme
    • Zod & Typing
    • Internationalization
Projects
  • API Connections & Tools
  1. Documentation
  2. Coding Standards

Naming & Linter Rules

Strict semantic conventions designed to eliminate ambiguity and technical debt through static analysis.

Project Coding Standards

Benefits: Naming consistency simplifies navigation, and automated linter checks prevent architectural debt accumulation.

Project File Structure Example

01Naming Conventions

Universally using kebab-case. Exceptions: hooks (use prefix), utility files (entity.type.ts format), and standard Next.js files.

File Naming Examples
1// kebab-case и семантические расширения 2src/entities/tour/schema/finance-info.schema.ts 3src/entities/tour/api/tour.service.ts 4src/entities/tour/converters/tour.converters.ts 5src/entities/tour/handlers/tour.handlers.ts 6src/entities/tour/mock/tour-finance.mock.ts 7src/entities/tour/constants/tour-status.config.ts

02Types and Code:

Interfaces with I prefix, types with T prefix, enums with ENUM_ prefix. Components use PascalCase.

Typing Conventions
1// Префиксы для типов и интерфейсов 2interface IEntity { ... } 3type TResponse = { ... } 4const ENUM_STATUS = { ... } as const;

03FSD Import Architecture

Classic layer hierarchy: shared is the lowest, app is the highest. Upward imports or imports between elements of the same layer are strictly prohibited.

FSD Import Rules
1// FSD Import Boundaries (Classic) 2app -> [pages, widgets, features, entities, shared] 3pages -> [widgets, features, entities, shared] 4widgets -> [features, entities, shared] 5features -> [entities, shared] 6entities -> [shared] 7shared -> []

04Technical Relaxations

Specific exceptions for external libraries (shadcn-ui), type declarations (.d.ts), and system configurations where strict naming might interfere with operation.

Project Relaxations
1// Проектные послабления (Relaxations) 2// 1. Shared UI (shadcn-ui/custom): любые имена, разрешен any 3src/shared/ui/shadcn-ui/Button.tsx 4 5// 2. Декларации (.d.ts): именование не контролируется 6src/shared/types/api.d.ts 7 8// 3. Конфиги (*.config.ts): разрешены require и console 9tailwind.config.ts