AI SummaryWhen reviewing or writing code, ensure:
Install
Copy this and paste it into Claude Code, Cursor, or any AI assistant:
I want to add the "feiertagejs — Cursor Rules" prompt rules to my project. Repository: https://github.com/sfakir/feiertagejs Please read the repo to find the rules/prompt file, then: 1. Download it to the correct location (.cursorrules, .windsurfrules, .github/prompts/, or project root — based on the file type) 2. If there's an existing rules file, merge the new rules in rather than overwriting 3. Confirm what was added
Description
Feiertage.js is a small npm module to calculate German holidays for each Bundesland
Code Style & Formatting
• Formatting: Use Prettier with project settings (80 char width, 2 spaces, single quotes, trailing commas) • Linting: Follow ESLint rules (TypeScript recommended rules) • TypeScript: Use strict mode, no unused locals • Line length: Maximum 80 characters per line
TypeScript Best Practices
• Type Safety: Always use explicit types for function parameters and return values • Type Imports: Use type imports when importing only types: import type { Holiday } from './holiday' • Union Types: Use union types for constants (e.g., HolidayType, Region) • No any: Avoid any type - use unknown if type is truly unknown • Strict Mode: All TypeScript strict checks are enabled
Function Organization
• Public Functions: Must have JSDoc comments with @param and @returns tags • Private Functions: Mark with @private in JSDoc, use descriptive camelCase names • Validation: Always validate inputs using checkRegion() and checkHolidayType() before processing • Error Messages: Use descriptive error messages prefixed with [feiertagejs] for library errors
Date Handling
• Date Creation: Always use makeDate(year, naturalMonth, day) helper for creating dates (naturalMonth is 1-12) • Date Arithmetic: Use addDays(date, days) helper for date calculations • Date Comparison: Use toUtcTimestamp(date) for comparing dates (normalizes to midnight local time) • Date Strings: Use localeDateObjectToDateString(date) for creating ISO date strings (YYYY-MM-DD) • Timezone Awareness: ⚠️ Known Bug: UTC dates should be converted to German timezone (CET/CEST) before checking holidays, but currently they are not. This needs to be fixed.
Discussion
Health Signals
My Fox Den
Community Rating
Sign in to rate this booster
Works With
Any AI assistant that accepts custom rules or system prompts