hostinger-reach
Last commit date
frontend
4 weeks ago
languages
1 month ago
src
3 weeks ago
templates
7 months ago
vendor
3 weeks ago
changelog.txt
3 weeks ago
coderabbit.yaml
8 months ago
composer.json
3 weeks ago
hostinger-reach.php
3 weeks ago
package.json
4 weeks ago
readme.txt
3 weeks ago
coderabbit.yaml
132 lines
| 1 | language: "en-US" |
| 2 | early_access: false |
| 3 | tone_instructions: "Expert Vue 3, TypeScript & WordPress PHP reviewer for enterprise development. Provide concise, clear advice based on project's actual patterns. Elaborate only when requested." |
| 4 | |
| 5 | reviews: |
| 6 | profile: "chill" |
| 7 | request_changes_workflow: false |
| 8 | high_level_summary: true |
| 9 | poem: false |
| 10 | review_status: true |
| 11 | collapse_walkthrough: true |
| 12 | |
| 13 | auto_review: |
| 14 | enabled: true |
| 15 | drafts: true |
| 16 | ignore_title_keywords: |
| 17 | - "WIP" |
| 18 | - "Draft" |
| 19 | - "DO NOT MERGE" |
| 20 | - "TEMP" |
| 21 | |
| 22 | path_instructions: |
| 23 | - path: "**/*.{vue,ts,js}" |
| 24 | instructions: | |
| 25 | **No English Text:** Never use hardcoded English text - always use translation slugs |
| 26 | **Translation Slugs:** Use project pattern: `hostinger_reach_section_element_type` |
| 27 | **Translation Functions:** Use `translate()` function: `translate("hostinger_reach_section_element")` |
| 28 | **Repository Pattern:** Create repositories for API calls - don't make direct HTTP requests in components |
| 29 | **Naming:** Use camelCase for all variables and functions - no snake_case in frontend code |
| 30 | |
| 31 | - path: "**/*.vue" |
| 32 | instructions: | |
| 33 | **Props:** Type with interfaces: `defineProps<{ userId: string }>()` |
| 34 | **Emits:** Explicit declarations: `defineEmits<{ update: [value: string] }>()` |
| 35 | **Keys:** Use `:key="item.id"` not `:key="index"` in v-for |
| 36 | **Reactivity:** Use `ref()` for primitives, `computed()` for derived state |
| 37 | **Heavy Computations:** Place complex computations in parent components and pass results as props |
| 38 | **Accessibility:** Use semantic HTML and ARIA attributes - `<button aria-label="close">` not `<div @click>` |
| 39 | **Conditionals:** Use `v-if` for conditional DOM, `v-show` for visibility toggle |
| 40 | **Cleanup:** Clear timers/listeners in `onUnmounted` |
| 41 | **Component Design:** Single responsibility, extend via props/slots, minimal prop requirements |
| 42 | |
| 43 | - path: "**/*.ts" |
| 44 | instructions: | |
| 45 | **Type Safety:** Use strict TypeScript - avoid `any`, prefer specific types |
| 46 | **Union Types:** `type Status = 'pending' | 'success' | 'error'` |
| 47 | **Interface Design:** Prefer interfaces over types for object shapes |
| 48 | **Generics:** Use generics for reusable type definitions |
| 49 | **Utility Types:** Leverage TypeScript utility types: `Partial<T>`, `Required<T>`, `Pick<T, K>` |
| 50 | |
| 51 | - path: "**/*.php" |
| 52 | instructions: | |
| 53 | **PHPCS Compliance:** Follow coding standards defined in `.phpcs.xml` - formatting, spacing, naming conventions |
| 54 | **Project Architecture:** Repository pattern for DB queries, DTO classes for data transfer, dependency injection via constructors |
| 55 | **WordPress Integration:** Escape output with `esc_html()`, `esc_url()`, verify nonces with `wp_verify_nonce()` |
| 56 | **Naming Conventions:** Database tables/options prefixed with `hostinger_`, class suffixes: `UserFactory`, `UserDto`, `UserRepository` |
| 57 | **Code Organization:** Constants in dedicated classes, translations in static methods, early returns over else statements |
| 58 | **Error Handling:** Prefix error logs: `error_log('Hostinger Reach: error message')` |
| 59 | |
| 60 | - path: "**/stores/**/*.ts" |
| 61 | instructions: | |
| 62 | **Store Pattern:** Use `defineStore` with setup syntax matching your `generalDataStore` pattern |
| 63 | **State:** Use `ref()` for reactive state, `computed()` for derived values |
| 64 | **File Naming:** `{camelCase}Store.ts` |
| 65 | **Destructuring:** Use `storeToRefs()` when needed |
| 66 | |
| 67 | - path: "**/composables/**/*.ts" |
| 68 | instructions: | |
| 69 | **Naming:** Use 'use' prefix: `useOverviewData`, `useModal` |
| 70 | **File Naming:** `use{PascalCase}.ts` |
| 71 | **Return:** Return refs that can be destructured: `return { data, loading, error }` |
| 72 | |
| 73 | - path: "**/repositories/**/*.ts" |
| 74 | instructions: | |
| 75 | **Repository Pattern:** Export default object like your `formsRepo`, `reachRepo` pattern |
| 76 | **Method Naming:** Use descriptive names: `getForms`, `toggleFormStatus`, `getOverview` |
| 77 | **Headers:** Include correlation ID and nonce like your existing repos |
| 78 | **Typing:** Use proper TypeScript types: `httpService.get<Form[]>` |
| 79 | |
| 80 | - path: "**/*.test.ts" |
| 81 | instructions: | |
| 82 | **Structure:** Use `describe/it` blocks: `describe('ConfirmDisconnectModal', () => { it('should render', () => {}) })` |
| 83 | **Imports:** Import `vi` from vitest: `import { vi } from 'vitest'` |
| 84 | **Mounting:** Use `mount` from `@vue/test-utils` |
| 85 | **Mocking:** Use `vi.mock()` for stores and composables like your existing tests |
| 86 | **Store Mocking:** Mock stores with return objects matching your pattern |
| 87 | |
| 88 | - path: "**/tests/**/*.php" |
| 89 | instructions: | |
| 90 | **Test Structure:** Extend from `WP_UnitTestCase` class following WordPress core standards |
| 91 | **Setup Methods:** Use `set_up(): void` with `parent::set_up()` FIRST LINE (snake_case required) |
| 92 | **Teardown Methods:** Use `tear_down(): void` with `parent::tear_down()` as LAST LINE |
| 93 | **Method Names:** `snake_case` for test methods: `test_integrations_constant()` |
| 94 | **Fixtures:** Use `self::factory()->user->create()` for test data creation |
| 95 | **Mocking:** Use `createMock()` for dependencies like your existing tests |
| 96 | **Assertions:** Use most specific assertion: `assertSame()`, `assertContains()`, `assertTrue()` |
| 97 | **WordPress Methods:** Use snake_case versions: `set_up_before_class()`, `tear_down_after_class()` |
| 98 | |
| 99 | - path: "**/*" |
| 100 | instructions: | |
| 101 | **Commit Messages:** Follow semantic format: `<type>(<scope>): <subject>` |
| 102 | **Commit Types:** Use `feat`, `fix`, `docs`, `style`, `refactor`, `test`, `chore` |
| 103 | **Deep Review:** Mark complex PRs with "deep review wanted" label and provide clear testing instructions |
| 104 | **File Structure:** PHP files under `src/`, Vue under `frontend/vue/`, React/Gutenberg under `frontend/blocks/` |
| 105 | **PSR-4:** Follow PSR-4 autoloader standard with proper namespace mapping |
| 106 | |
| 107 | path_filters: |
| 108 | - "**/*.vue" |
| 109 | - "**/*.ts" |
| 110 | - "**/*.php" |
| 111 | - "**/*.{test,spec}.{ts,php}" |
| 112 | - "package.json" |
| 113 | - "composer.json" |
| 114 | - "!**/node_modules" |
| 115 | - "!**/vendor" |
| 116 | - "!**/dist" |
| 117 | - "!coverage/**" |
| 118 | - "!**/*.min.js" |
| 119 | - "!**/*.min.css" |
| 120 | - "!**/*.d.ts" |
| 121 | - "!package-lock.json" |
| 122 | - "!composer.lock" |
| 123 | |
| 124 | tools: |
| 125 | eslint: |
| 126 | enabled: true |
| 127 | phpcs: |
| 128 | enabled: true |
| 129 | |
| 130 | chat: |
| 131 | auto_reply: true |
| 132 |