refactor: привести проект к стайлгайду

- Убран FC из всех шаблонов и компонентов
- Заменён interface на type, .interface.ts на .type.ts
- Добавлен паттерн Params/Props/RootAttrs в типы
- Деструктуризация пропсов перенесена в тело компонента
- Добавлены styles/ и types/ для feature, entity, widget, screen
- Добавлен расширенный JSDoc-шаблон с назначением и сценариями
- Исправлен баг в index.ts шаблона component
- Добавлены .editorconfig, .env.example
- Добавлен organizeImports.biome в .vscode/settings.json
- Исправлен .gitignore для .env.example
- Переписан README под проект-шаблон
- Удалён CLAUDE.md
This commit is contained in:
2026-04-02 17:01:22 +03:00
parent 9e2167b34d
commit 7382499886
24 changed files with 212 additions and 71 deletions

View File

@@ -0,0 +1,2 @@
.root {
}

View File

@@ -0,0 +1,11 @@
import type { HTMLAttributes } from 'react'
/**
* Параметры сущности {{name.pascalCase}}.
*/
export type {{name.pascalCase}}EntityParams = {}
/** HTML-атрибуты корневого элемента. */
type RootAttrs = HTMLAttributes<HTMLDivElement>
export type {{name.pascalCase}}EntityProps = RootAttrs & {{name.pascalCase}}EntityParams

View File

@@ -1,12 +1,20 @@
import type { FC } from 'react'
import cl from 'clsx'
import type { {{name.pascalCase}}EntityProps } from './types/{{name.kebabCase}}.type'
import styles from './styles/{{name.kebabCase}}.module.css'
/**
* Сущность {{name.pascalCase}}.
* <Назначение сущности {{name.pascalCase}} в 1 строке>.
*
* Используется для:
* - <сценарий 1>
* - <сценарий 2>
*/
export const {{name.pascalCase}}Entity: FC = () => {
export const {{name.pascalCase}}Entity = (props: {{name.pascalCase}}EntityProps) => {
const { children, className, ...htmlAttr } = props
return (
<div>
{{name.kebabCase}}
<div {...htmlAttr} className={cl(styles.root, className)}>
{children}
</div>
)
}