|
36 | 36 | should be able to predict where things are located and how they are structured.
|
37 | 37 |
|
38 | 38 | - **Predictability**
|
39 |
| - Every file and component follows the **same structure**, reducing ambiguity. Naming conventions, folder structures, |
| 39 | + Every file and component follows a **consistent structure**, minimizing ambiguity. Naming conventions, folder structures, |
40 | 40 | and function placements should remain consistent across the entire codebase.
|
41 | 41 |
|
42 | 42 | - **Clarity Over Flexibility**
|
@@ -99,7 +99,7 @@ structure keeps related files **encapsulated** while providing clear separation
|
99 | 99 | - If a constant or utility **is used in more than one feature**, move it here.
|
100 | 100 | - **Example:** `constants/guideUtils.ts` contains `getGuideDetailsUrl` since it is used in multiple places (e.g.,
|
101 | 101 | dashboard & profiles).
|
102 |
| - - **Feature-specific constants and utils** should remain inside the **feature folder** (e.g., |
| 102 | + - **Feature-specific constants and utilities** should remain inside the **respective feature folder** (e.g., |
103 | 103 | `pages/profile/profileConstants.ts`).
|
104 | 104 |
|
105 | 105 | - **Assets Handling**
|
@@ -158,6 +158,7 @@ Using **barrel files (`index.ts`)** can simplify imports and improve readability
|
158 | 158 |
|
159 | 159 | - Import unnecessary code, even if unused.
|
160 | 160 | - Make code harder to track, increasing debugging complexity.
|
| 161 | +- Wildcard imports (`import *`) force the bundler to include unused code, increasing bundle size and reducing tree-shaking efficiency. |
161 | 162 |
|
162 | 163 | ```ts
|
163 | 164 | import * as utils from ‘common/utils’
|
@@ -1241,8 +1242,7 @@ export const PageRoutes = () => {
|
1241 | 1242 | - **New feature flags must be added to featureFlags.ts**
|
1242 | 1243 | - This ensures **visibility** and prevents unexpected feature toggles.
|
1243 | 1244 | - **Use feature flags only for meaningful toggles**
|
1244 |
| - - Avoid flagging trivial UI changes. |
1245 |
| - - Flags should be used for **significant features, redesigns, or experiments**. |
| 1245 | + - Feature flags should be reserved for **substantial feature rollouts, experiments, or redesigns**—not minor UI tweaks. |
1246 | 1246 | - **Local storage overrides take precedence**
|
1247 | 1247 | - Developers can **manually toggle flags via local storage**, making testing easier.
|
1248 | 1248 |
|
|
0 commit comments