Prompt
Use proper naming conventions to make code more readable and maintainable:
- Functions should start with verbs that describe their action:
// Incorrect const hasChanges = () => { ... } // Correct const checkForChanges = () => { ... } - Use descriptive names for generated outputs that include relevant context:
// Too generic element.download = `taskInstanceLogs.txt`; // Better - includes relevant identifiers element.download = `${dagId}-${taskId}-${runId}-${mapIndex}-${tryNumber}.txt`; - Maintain consistent casing for related identifiers, especially when filtering or comparing:
// Define consistent casing pattern for categories const existingCategories = ["user", "docs", "admin", "browse"]; // Use consistent transformation when comparing if (!existingCategories.includes(category.toLowerCase())) { // ... }
Following these conventions improves code clarity and reduces confusion when maintaining code across a team.