Today's Work: Adding Legal and Recipe Pages
I added three new pages to the project:
- Privacy Policy
- Legal Notice based on the Act on Specified Commercial Transactions
- Recipe Ideas
These pages are important for both compliance and user engagement.
Standardizing Function Syntax Across Files
While working on these pages, I noticed inconsistent patterns in how functions were written and exported:
- Pattern 1: Named function + default export
- Pattern 2: Arrow function assigned to a variable + default export
To improve maintainability and consistency, I decided to standardize all components to use Pattern 2 (arrow functions with variable assignment and default export).
Lessons Learned: Planning Ahead Saves Time
Because I didn’t decide on a consistent coding style from the start, I ended up spending significant time refactoring later.
This reinforced the idea that 90% of the work is preparation, and 10% is execution.
Next Steps: Enforcing Code Style with ESLint
To prevent similar issues going forward, I set up an ESLint rule to enforce arrow function usage:
javascript
// .eslintrc.js
rules: {
"prefer-arrow-callback": "error", // Enforce arrow functions
}
I also configured my editor’s formatter to align with this rule for seamless development.
Standardizing coding patterns early helps keep projects clean and efficient, a small effort that pays off big in the long run.
Tomorrow’s Plan
I will work on adding the section for the lists of EC sites.
tags: portfolio, webdev, javascript, react, eslint
Top comments (0)