-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.cursorrules
131 lines (131 loc) · 3.3 KB
/
.cursorrules
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
{
"typescript": {
"rules": {
"explicit-function-return-type": {
"enabled": true,
"description": "All functions must have an explicit return type annotation",
"severity": "warning",
"allowedNames": ["page", "layout", "loading", "error", "not-found"],
"examples": {
"correct": [
"function example(): void { }",
"const example = (): string => { return 'hello'; }",
"async function fetchData(): Promise<Data> { }"
],
"incorrect": [
"function example() { }",
"const example = () => { return 'hello'; }",
"async function fetchData() { }"
]
}
},
"no-explicit-any": {
"enabled": true,
"description": "Avoid using the 'any' type",
"severity": "warning",
"rules": {
"forbidden": "any",
"suggestions": [
"unknown",
"Record<string, unknown>",
"specific-type"
]
}
},
"consistent-type-imports": {
"enabled": true,
"description": "Use type imports consistently",
"severity": "error",
"examples": {
"correct": [
"import type { User } from '@/types';",
"import type { ReactNode } from 'react';"
],
"incorrect": [
"import { User } from '@/types';",
"import { type ReactNode } from 'react';"
]
}
},
"no-unused-vars": {
"enabled": true,
"description": "No unused variables",
"severity": "error",
"rules": {
"ignorePattern": "^_"
}
},
"no-console": {
"enabled": true,
"description": "No console statements except warn and error",
"severity": "warning",
"rules": {
"allowed": ["warn", "error"]
}
},
"prettier-format": {
"enabled": true,
"description": "Follow project's Prettier configuration",
"severity": "warning",
"rules": {
"useTabs": true,
"tabWidth": 1,
"singleQuote": true,
"semi": true,
"trailingComma": "es5",
"printWidth": 100,
"indentStyle": "tab"
}
},
"import-order": {
"enabled": true,
"description": "Enforce consistent import ordering",
"severity": "warning",
"rules": {
"groups": [
"builtin",
"external",
"internal",
"parent",
"sibling",
"index",
"object",
"type"
],
"newlines-between": "always",
"alphabetize": {
"order": "asc",
"caseInsensitive": true
}
},
"examples": {
"correct": [
"import { useState } from 'react';\n\nimport { Button } from '@/components/ui/button';\n\nimport { useUser } from './hooks';",
"import type { User } from '@/types';\nimport { auth } from '@clerk/nextjs';\n\nimport { db } from '@/lib/db';"
],
"incorrect": [
"import { db } from '@/lib/db';\nimport { useState } from 'react';",
"import { useUser } from './hooks';\nimport { Button } from '@/components/ui/button';"
]
}
},
"api-client-usage": {
"enabled": true,
"description": "Client-side code must use apiClient, server-side code must use supabase directly",
"clientPattern": "src/**/*.{ts,tsx}",
"serverPattern": "src/app/**/*.{ts,tsx}",
"rules": {
"client": {
"required": "apiClient",
"forbidden": "supabase"
},
"server": {
"required": "supabase",
"forbidden": "apiClient"
}
},
"severity": "warning"
}
}
}
}