diff --git a/.cursor/rules/fix-problems.mdc b/.cursor/rules/fix-problems.mdc index 2964987d..f2dd056b 100644 --- a/.cursor/rules/fix-problems.mdc +++ b/.cursor/rules/fix-problems.mdc @@ -11,7 +11,8 @@ VERY IMPORTANT: When encountering ANY problem in the code—such as TypeScript e - **Refactor for correctness**: Resolve issues by improving the code structure, using precise types, type guards, proper error handling, and best practices. - **Investigate root causes**: Use tools like debugging, logging, or code searches to understand why the problem occurs before fixing it. - **Align with existing rules**: Follow related policies such as the Fix TypeScript Errors Policy (adapt for other languages), ESLint configurations, and accessibility guidelines. -- **Test the fix**: After fixing, verify with tests, linting runs (e.g., `yarn lint:fix`), or manual checks to ensure the problem is truly resolved without introducing new issues. +- **Test the fix**: After fixing, verify with tests, linting runs (e.g., `yarn lint:fix`, `yarn test`), or manual checks to ensure the problem is truly resolved without introducing new issues. +- **Terminal commands**: if you run a command in the terminal make sure to set timeout so the command is not being executed indefinitely ## When to Apply - During any code editing, reviewing, or generation task. diff --git a/.gitignore b/.gitignore index 0ca7788c..ab6cd43b 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ node_modules/* npm-debug.log yarn-error.log +.yarn/install-state.gz +install-state.gz test-results diff --git a/.vscode/settings.json b/.vscode/settings.json index eeb50194..317fe7f3 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,5 +13,5 @@ "source.fixAll.eslint": "always" }, "eslint.useFlatConfig": true, - + "editor.formatOnSave": false } diff --git a/.windsurf/rules/do-not-modify-configs.md b/.windsurf/rules/do-not-modify-configs.md new file mode 100644 index 00000000..99df6461 --- /dev/null +++ b/.windsurf/rules/do-not-modify-configs.md @@ -0,0 +1,25 @@ +--- +trigger: always_on +description: +globs: +--- + +# Rule: DO NOT MODIFY configuration files unless explicitly instructed + +## Description +You MUST **never modify any configuration files** (such as `vite.config.ts`, `tsconfig.json`, `.eslintrc`, `package.json`, `.env`, etc.) **unless explicitly told to do so** in the current request or accompanying instructions. + +## Examples + +✅ **Allowed** +- Editing TypeScript source files, tests, or component code. +- Updating imports, logic, or styles within non-config files. +- Adding configuration changes **only when explicitly requested** (e.g., “Add a new alias in `vite.config.ts`”). + +❌ **Not Allowed** +- Modifying or creating any config files without explicit instruction. +- Automatically adding dependencies or changing build/test settings. +- Altering environment variables or global project settings without being told to. + +## Enforcement +If you believe a configuration change might be required, **ask for confirmation first** before proceeding. diff --git a/.windsurf/rules/fix-problems.md b/.windsurf/rules/fix-problems.md new file mode 100644 index 00000000..44bd8040 --- /dev/null +++ b/.windsurf/rules/fix-problems.md @@ -0,0 +1,26 @@ +--- +trigger: always_on +description: +globs: +--- + +# Fix Problems Policy + +## Core Principle +VERY IMPORTANT: When encountering ANY problem in the code—such as TypeScript errors, linting issues, runtime bugs, accessibility violations, or performance problems—you or any other problem MUST find a proper way to fix it. Do NOT silence, suppress, or avoid the problem using workarounds like `// @ts-ignore`, `any` types, or ignoring linter warnings. + +## Preferred Approaches +- **Refactor for correctness**: Resolve issues by improving the code structure, using precise types, type guards, proper error handling, and best practices. +- **Investigate root causes**: Use tools like debugging, logging, or code searches to understand why the problem occurs before fixing it. +- **Align with existing rules**: Follow related policies such as the Fix TypeScript Errors Policy (adapt for other languages), ESLint configurations, and accessibility guidelines. +- **Test the fix**: After fixing, verify with tests, linting runs (e.g., `yarn lint:fix`), or manual checks to ensure the problem is truly resolved without introducing new issues. +- **Terminal commands**: if you run a command in the terminal make sure to set timeout so the command is not being executed indefinitely + +## When to Apply +- During any code editing, reviewing, or generation task. +- Proactively scan for and fix problems in affected files using available tools (e.g., read_lints, grep, codebase_search). +- If a problem persists after reasonable efforts, document it clearly and suggest next steps rather than suppressing it. + +## Notes +- This policy promotes robust, high-quality code that is easier to maintain and less prone to future issues. +- If unsure how to fix a problem, use tools to gather more information or break it into smaller, solvable parts rather than bypassing it. diff --git a/.windsurf/rules/src/frontend/accessibility.md b/.windsurf/rules/src/frontend/accessibility.md new file mode 100644 index 00000000..861428da --- /dev/null +++ b/.windsurf/rules/src/frontend/accessibility.md @@ -0,0 +1,120 @@ +--- +trigger: always_on +description: Enforce accessibility best practices so all users can use the application +globs: +--- + +### Accessibility guidance (must follow) + +- Semantics first + - Prefer semantic HTML (`button`, `a`, `nav`, `main`, `header`, `footer`, `ul/ol/li`, `table/th/td`) over generic `div`/`span`. + - Use `button` for actions and `a`/`Link` for navigation. Do not use click handlers on non-interactive elements. If unavoidable, add `role="button"`, `tabIndex={0}`, and keyboard handlers for Enter/Space. + +- Keyboard support + - All interactive controls must be reachable via Tab and operable via keyboard. + - Do not remove focus outlines. If customizing, ensure visible `:focus-visible` styles with sufficient contrast. + - Preserve a logical tab order; avoid `tabIndex` > 0. + +- Focus management + - On opening modals/drawers/popovers: move focus inside, trap focus, and restore focus to the trigger on close. + - Provide a skip link to main content (e.g., `href="#main"`) and landmark roles (`
`, `