Linting and formatting commands
Run these commands to check and fix code style issues:Pre-commit hooks
The project uses Husky for Git pre-commit hooks. These hooks run automatically when you commit and enforce code quality standards before changes are recorded.Commit guidelines
This project follows the Conventional Commits specification.Commit message format
- Messages must include a type prefix as described in Conventional Commits
- Messages must be written in lowercase, except for proper nouns
- Messages must not end with a period
.
Commit signing
Commits should be signed. See GitHub’s commit signing documentation for setup instructions.JavaScript and TypeScript
Import standards
- Do not import
Reactdirectly — only import the specific modules you need - Use
import typefor type-only imports - Prefer named imports over default imports where possible
- Node.js built-in modules
- External library imports (including
@node-core/*) - Relative imports (
./*,../*,#specifier/) - Type-only imports at the end of each given section
Component guidelines
- Use the
FCtype from React for component definitions - Use
FC<PropsWithChildren<MyComponentProps>>when the component accepts achildrenprop - Prefix prop type names with the component name (e.g.
MyComponentProps) - Always use default exports for React components
- Avoid direct DOM or Web API access in components — use hooks or utilities instead
- CSS imports should always be the last import in the file
Example component structure
CSS guidelines
The project uses PostCSS and Tailwind CSS. All component styles must be written in CSS Modules.- Use camelCase for CSS class names
- Use Tailwind’s
@applydirective to apply utility classes - Define one Tailwind utility class per line for readability
- Avoid plain CSS properties and inline styles in JavaScript
- Write all styles inside CSS Modules — no inline styles
File naming conventions
Components
Components
- Component folders:
PascalCase - Component files:
index.tsx(orPascalCase.tsxif no subdirectory is needed) - Style files:
index.module.css - Test files:
__tests__/index.test.mjs - Story files:
index.stories.tsx
General files
General files
- Use
kebab-casefor most file names (e.g. documentation and content files) - Use
camelCasefor utility functions and configuration files - Use
PascalCaseonly for React components
Code organization
- Keep related files together in component folders
- Use index files for clean imports
- Group similar functionality in dedicated directories
- Follow the established patterns in the existing codebase
Documentation standards
- Use JSDoc comments for complex functions and utilities
- Document component props with TypeScript interfaces
- Include Storybook stories for UI components
- Keep README files updated when making significant changes
Performance guidelines
- Import only what you need to minimize bundle size
- Use dynamic imports for large components where appropriate
- Optimize images and assets
- Follow React best practices for rendering performance
IDE configuration
The repository includes a.vscode directory with recommended settings. If you use VS Code, these settings are applied automatically.
Recommended extensions:
| Extension | Purpose |
|---|---|
esbenp.prettier-vscode | Prettier formatting |
bradlc.vscode-tailwindcss | Tailwind CSS IntelliSense |
stylelint.vscode-stylelint | CSS linting |
unifiedjs.vscode-mdx | MDX file support |
dbaeumer.vscode-eslint | ESLint for JS/TS |
editorconfig.editorconfig | EditorConfig support |