Skip to content
Prompt

feiertagejs — Cursor Rules

by sfakir

AI Summary

When 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

0/2000
Loading comments...

Health Signals

MaintenanceCommitted 2mo ago
Active
AdoptionUnder 100 stars
75 ★ · Niche
DocsREADME + description
Well-documented

GitHub Signals

Stars75
Forks12
Issues2
Updated2mo ago
View on GitHub
MIT License

My Fox Den

Community Rating

Sign in to rate this booster

Works With

Any AI assistant that accepts custom rules or system prompts

Claude
ChatGPT
Cursor
Windsurf
Copilot
+ more