- Component names will be in PascalCase.
- All new components will be functional components.
- Component lines should not exceed 350 lines unless unavoidable.
- Use Redux only to save backend information that needs to be used app-wide.
- Use a flat component structure for designing flows (child component level should not exceed 2, unless unavoidable).
- Use Context API if the flow is large and requires managing many components with many states.
- Only use
let
,const
, and arrow functions. - Avoid using array native functions, prefer Lodash instead.
- Design components should be made common inside the modules folder.
- Avoid JSX variables unless unavoidable.
- Declare states at the top, unless unavoidable.
- Library imports should be on top, followed by a space, and then the rest of the imports.
- For TypeScript Props definitions, required props come first, followed by a space, and then optional props.
- No inline styles unless necessary, and try to clean them up if present.
- No inline function definitions.
- All functions and variables will use underscores (
_
). - App Flows: Organize screens that work together cohesively.
- File and folder structure:
- Feature Name Folder
- Feature Name File
- Logic separation: Feature File contains all the logic.
- Components Folder: For child components.
- Styles: Separated from logic.
- Helpers: Utility functions.
- Write styles and logic inside the component if the file doesn't exceed 350 lines.
- Data Transformers: To handle data transformations.
- Context: Stored in
context.ts
.
-
String localization: Add text lines in the
en
file and use thet
function to translate. -
Squash and merge feature/fix branches.
-
Branch naming:
feat-{feature-name}
fix-{fix-name}
chore-{chore-name}
-
Generic Library Rules:
Follow generic library rules. Use Text and other design patterns consistently.