Rules Hub
Coding Rules Library
Rule priority, scope & exceptions
Use this to align rules with the senior-level structure (P0/P1/P2, scope, exceptions/tradeoffs).
Use PascalCase for Component Subfolder Names
A component's own directory (e.g. `Loader/`) should be PascalCase, not lowercase, matching the component name.
Bad example
| 1 | components/Widget/loader/Loader.tsx |
| 2 | components/Widget/loader/index.ts |
Explanation (EN)
Names the component's own folder in lowercase (`loader`) while the component and file inside are PascalCase (`Loader.tsx`), breaking the project's convention that a component's directory name matches its PascalCase name.
Objašnjenje (HR)
Folder same komponente imenuje malim slovima (`loader`) dok su komponenta i file unutra u PascalCase-u (`Loader.tsx`), čime se krši konvencija projekta da ime direktorija komponente odgovara njezinom PascalCase imenu.
Good example
| 1 | components/Widget/Loader/Loader.tsx |
| 2 | components/Widget/Loader/index.ts |
Explanation (EN)
Matches the folder name to the PascalCase component name, keeping the directory structure consistent and predictable across the codebase.
Objašnjenje (HR)
Uskladuje ime foldera s PascalCase imenom komponente, čime struktura direktorija ostaje konzistentna i predvidljiva kroz cijeli kod.