diff --git a/.cspell.json b/.cspell.json new file mode 100644 index 000000000..0e6951f02 --- /dev/null +++ b/.cspell.json @@ -0,0 +1,98 @@ +{ + "version": "0.2", + "language": "en", + "words": [ + "autofocused", + "behaviour", + "behaviours", + "Behaviour", + "cacheable", + "Cantarell", + "chainer", + "Chainer", + "chatbots", + "childs", + "codexteam", + "colspan", + "constructables", + "contenteditable", + "Contenteditable", + "contentless", + "Contentless", + "convertable", + "Convertable", + "convertible", + "Convertible", + "cssnano", + "cssnext", + "Debouncer", + "devserver", + "editorjs", + "Editorjs", + "entrypoints", + "Flippable", + "flippable", + "GRAMMARLY", + "Gfycat", + "hsablonniere", + "hspace", + "intellij", + "keydown", + "keydowns", + "Kilian", + "leftarrow", + "licence", + "mergeable", + "movetostart", + "mouseleave", + "navigatable", + "nofollow", + "opencollective", + "preconfigured", + "radiobutton", + "resetors", + "rowspan", + "Segoe", + "selectall", + "sometool", + "strongs", + "stylelint", + "textareas", + "toolname", + "twitterwidget", + "typeof", + "UPLUCID", + "Unmergeable", + "rgba", + "Roboto", + "Fira", + "Neue", + "grayscale", + "Menlo", + "Consolas", + "viewports", + "sonarjs", + "Unregisters", + "IAPI", + "Jamison", + "Minzipped", + "srcset", + "youtu", + "Dont", + "CONTENTLESS", + "autofocusable", + "Pettit" + ], + "ignorePaths": [ + "dist/**", + "node_modules/**", + "test-results/**", + "cypress/downloads/**" + ], + "flagWords": [], + "ignoreRegExpList": [ + "/[\\u0080-\\uFFFF]+/", + "/\"[A-Za-z0-9]{8,}\"/" + ] +} + diff --git a/.cursor/rules/do-not-modify-configs.mdc b/.cursor/rules/do-not-modify-configs.mdc new file mode 100644 index 000000000..bc24d21d1 --- /dev/null +++ b/.cursor/rules/do-not-modify-configs.mdc @@ -0,0 +1,23 @@ +--- +alwaysApply: true +--- + +# 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/.cursor/rules/fix-problems.mdc b/.cursor/rules/fix-problems.mdc new file mode 100644 index 000000000..2964987d1 --- /dev/null +++ b/.cursor/rules/fix-problems.mdc @@ -0,0 +1,23 @@ +--- +alwaysApply: true +--- + +# 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. + +## 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/.cursor/rules/src/frontend/accessibility.mdc b/.cursor/rules/src/frontend/accessibility.mdc new file mode 100644 index 000000000..085ff843e --- /dev/null +++ b/.cursor/rules/src/frontend/accessibility.mdc @@ -0,0 +1,119 @@ +--- +alwaysApply: true +description: Enforce accessibility best practices so all users can use the application +--- + +### 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 (`
`, `