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:
@@ -0,0 +1,11 @@
|
||||
import type { HTMLAttributes } from 'react'
|
||||
|
||||
/**
|
||||
* Параметры экрана {{name.pascalCase}}.
|
||||
*/
|
||||
export type {{name.pascalCase}}ScreenParams = {}
|
||||
|
||||
/** HTML-атрибуты корневого элемента. */
|
||||
type RootAttrs = HTMLAttributes<HTMLDivElement>
|
||||
|
||||
export type {{name.pascalCase}}ScreenProps = RootAttrs & {{name.pascalCase}}ScreenParams
|
||||
@@ -1,13 +1,20 @@
|
||||
import type { FC } from 'react'
|
||||
import cl from 'clsx'
|
||||
import type { {{name.pascalCase}}ScreenProps } from './types/{{name.kebabCase}}.type'
|
||||
import styles from './styles/{{name.kebabCase}}.module.css'
|
||||
|
||||
/**
|
||||
* Экран {{name.pascalCase}}.
|
||||
* <Назначение экрана {{name.pascalCase}} в 1 строке>.
|
||||
*
|
||||
* Используется для:
|
||||
* - <сценарий 1>
|
||||
* - <сценарий 2>
|
||||
*/
|
||||
export const {{name.pascalCase}}Screen: FC = () => {
|
||||
export const {{name.pascalCase}}Screen = (props: {{name.pascalCase}}ScreenProps) => {
|
||||
const { children, className, ...htmlAttr } = props
|
||||
|
||||
return (
|
||||
<div className={styles.root}>
|
||||
{{name.kebabCase}}
|
||||
<div {...htmlAttr} className={cl(styles.root, className)}>
|
||||
{children}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user