-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.coderabbit.yaml
More file actions
97 lines (85 loc) · 3.93 KB
/
.coderabbit.yaml
File metadata and controls
97 lines (85 loc) · 3.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
language: 'en-US'
early_access: false
reviews:
profile: 'assertive'
request_changes_workflow: true
high_level_summary: true
poem: false
review_status: true
collapse_walkthrough: false
auto_review:
enabled: true
drafts: false
ignore:
- 'pnpm-lock.yaml'
- 'apps/todo-lint-app/tests/__snapshots__/**'
path_instructions:
- path: 'lib/rules/*.js'
instructions: |
This is an ESLint rule implementation. Review for:
- Correct ESLint Rule API structure (meta + create pattern)
- meta.type, meta.docs, meta.messages, meta.schema must be present
- Rule options in meta.schema must match option handling and defaults inside create()
- If meta.fixable is set, verify fixer function produces correct output
- For autofix rules, validate "safe-to-fix" guards to avoid semantic behavior changes
- All messages must use messageId (no hardcoded strings in context.report)
- AST visitor functions must handle null/undefined node properties defensively
- Must use ESM export default (no module.exports/require)
- Functions should have JSDoc with @param, @returns, @example
- Rule file names must be kebab-case matching the rule name
- Prefer named constants over magic strings/numbers
- path: 'lib/utils/*.js'
instructions: |
Utility module for ESLint rules. Review for:
- Functions must be pure where possible (no side effects)
- Must use ESM named exports (no default export, no require)
- JSDoc with @param, @returns, @example on every exported function
- Keep utilities focused and reusable across multiple rules
- path: 'tests/lib/rules/*.test.js'
instructions: |
ESLint rule test using Mocha + RuleTester. Review for:
- Test file name must match the corresponding rule file name
- Must include both valid and invalid test cases
- Invalid cases must verify messageId (not just message text)
- If the rule is fixable, invalid cases must include output to verify fixes
- Edge cases: empty components, nested functions, TypeScript syntax
- Test descriptions should be clear and specific
- path: 'tests/lib/utils/*.test.js'
instructions: |
Utility function tests. Review for:
- Comprehensive input coverage including edge cases and null/undefined
- Each exported function should have dedicated test cases
- Use descriptive test names
- path: 'docs/rules/*.md'
instructions: |
ESLint rule documentation. Review for:
- Must include: rule description, fail/pass examples, options (if any)
- Examples must use JSX/React code that is syntactically valid
- File name must match the rule name (kebab-case)
- Link to the rule source should be correct
- path: 'index.js'
instructions: |
Plugin entry point. Every rule in lib/rules/ must be registered here.
Verify that new rules are added to the rules object and that
rule names match their file names.
- path: 'index.d.ts'
instructions: |
TypeScript type definitions for the plugin. Verify that:
- All rules from index.js are typed
- New rule names are reflected in LaststanceRuleModules
- The plugin type remains compatible with ESLint's flat config API
- path: 'apps/todo-lint-app/**'
instructions: |
Demo Next.js app used for integration testing. Review for:
- ESLint config must include all plugin rules
- Vitest lint snapshots must be updated when rule output changes
- Keep v9 (`src/`) and v10 (`tests/fixtures/eslint-v10/`) snapshot expectations consistent
- Do not introduce production dependencies unless necessary
tools:
eslint:
enabled: true
gitleaks:
enabled: true
chat:
auto_reply: true