-
Notifications
You must be signed in to change notification settings - Fork 32
/
.cursorrules
101 lines (91 loc) · 2.7 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
# Program Rules
Role play as a program that defines coding standards and development guidelines for a project using Next.js, React, TypeScript, shadcn/ui, and TailwindCSS.
Rules {
General {
factualAccuracy = true;
avoidHallucination = true;
conciseness = high;
formality = low;
accuracy = high;
response = AnswerFirst;
prioritizeLogic = true;
allowNewTech = true;
enforceCodeStyle = true;
implementFullCodeForFeatures = true;
}
ComponentGuidelines {
importFrom("@repo/ui");
units = "rems";
prioritize(reusability, modularity);
enforceNamingConventions = true;
followBestPractices("React");
validateProps = true;
optimizeFor("SEO");
ensureCompatibility("browsers", "devices");
ignoreImport("React");
avoid("React.FC");
referenceComponent = """
const operations = {
'+': (left, right) => left + right,
'-': (left, right) => left - right,
'*': (left, right) => left * right,
'/': (left, right) => left / right,
};
function Calculator({ left, operator, right }) {
const result = operations[operator](left, right);
return (
<div>
<code>{left} {operator} {right} = <output>{result}</output></code>
</div>
);
}
""";
}
TypeScript {
strictMode = true;
avoid("any");
prefer("unknown", withRuntimeChecks = true);
explicitTyping = true;
advancedFeatures("type guards", "mapped types", "conditional types");
organizeStructure("components", "pages", "hooks", "utils", "styles", "contracts", "services");
separateConcerns("presentation", "logic", "side effects");
useFormattingTool("Biome");
configureBiomeHook("pre-commit");
}
NextJS {
dynamicRoutes = true;
validateRouteParameters = true;
descriptiveRoutes = true;
dataFetchingMethods("getServerSideProps", "getStaticProps", "getStaticPaths");
implement("ISR");
optimizedImages = true;
configureImageAttributes = true;
}
TailwindCSS {
useUtilityClasses = true;
limitCustomCSS = true;
maintainClassOrder = true;
responsiveVariants = true;
defineDesignTokens = true;
}
DevelopmentProcess {
codeReviews = true;
PRDescriptions = true;
implementTesting("unit", "integration", "e2e");
prioritizeMeaningfulTests = true;
conventionalCommits = true;
incrementalCommits = true;
}
Biome {
useBiomeFor("formatting", "linting");
configureBiomeHook("pre-commit");
customizeBiome("biome.json");
maintainCodeConsistency = true;
runChecksBeforeCommit = true;
addressBiomeWarnings = true;
useBiomeImportOrganizer = true;
integrateBiomeIntoCI = true;
updateBiomeRegularly = true;
}
}
Rules();