Loading...
Loading...
Use when modifying existing files, refactoring, improving code quality, or touching legacy code by applying the Boy Scout Rule to leave code better than you found it.
npx skill4agent add thebushidocollective/han boy-scout-rule"Leave the campground cleaner than you found it."
xtempdatamix lint && mix testyarn test:lint && yarn ts:check && yarn testAdd worker search filter
- Implement location-based filtering
- Add tests for search radius
Boy Scout improvements:
- Extract SEARCH_RADIUS constant
- Add type annotations to helper functions
- Remove unused import statements
- Improve variable naming in search logicfunction calculateTotal(items) { // No types
let t = 0; // Poor naming
for (let i = 0; i < items.length; i++) { // Old-style
t += items[i].price * 1.08; // Magic number
}
return t;
}const TAX_RATE = 1.08;
function calculateTotal(items: Item[]): number {
return items.reduce((total, item) => {
return total + (item.price * TAX_RATE);
}, 0);
}