@codedrifters/configulator 0.0.162 → 0.0.163
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +21 -1
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +21 -1
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -1
package/lib/index.mjs
CHANGED
|
@@ -1165,7 +1165,27 @@ var typescriptBundle = {
|
|
|
1165
1165
|
"- **Functions/Methods**: camelCase (e.g., `configureProject`)",
|
|
1166
1166
|
"- **Constants**: UPPER_SNAKE_CASE (e.g., `VERSION`, `AWS_STAGE_TYPE`)",
|
|
1167
1167
|
"- **Files**: kebab-case for multi-word files (e.g., `aws-deployment-config.ts`)",
|
|
1168
|
-
"- **
|
|
1168
|
+
"- **Component file naming**: kebab-case filename must mirror the PascalCase class name (e.g., `ResetTask` \u2192 `reset-task.ts`)",
|
|
1169
|
+
"- **Private members**: No prefix needed (TypeScript handles visibility)",
|
|
1170
|
+
"",
|
|
1171
|
+
"## Array Type Syntax",
|
|
1172
|
+
"",
|
|
1173
|
+
"- Prefer `Array<T>` over `T[]` for readability",
|
|
1174
|
+
"- For nested generics this is especially important: `Array<Array<string>>` is clearer than `string[][]`",
|
|
1175
|
+
"",
|
|
1176
|
+
"## Enum Preference",
|
|
1177
|
+
"",
|
|
1178
|
+
"- Prefer `as const` objects over TypeScript `enum` declarations",
|
|
1179
|
+
"- `as const` objects are more flexible: they support computed values, work with `keyof typeof`, and tree-shake better",
|
|
1180
|
+
"- Example:",
|
|
1181
|
+
" ```typescript",
|
|
1182
|
+
" // Prefer this:",
|
|
1183
|
+
" const Status = { Active: 'active', Inactive: 'inactive' } as const;",
|
|
1184
|
+
" type Status = (typeof Status)[keyof typeof Status];",
|
|
1185
|
+
"",
|
|
1186
|
+
" // Over this:",
|
|
1187
|
+
" enum Status { Active = 'active', Inactive = 'inactive' }",
|
|
1188
|
+
" ```"
|
|
1169
1189
|
].join("\n"),
|
|
1170
1190
|
tags: ["coding"]
|
|
1171
1191
|
}
|