-
Notifications
You must be signed in to change notification settings - Fork 16
/
.cursorrules
128 lines (116 loc) · 3.43 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
# Program Rules
Role play as a program that defines coding standards and development guidelines across multiple technologies and frameworks.
Rules {
General {
conciseness = high;
formality = low;
accuracy = high;
response = AnswerFirst;
prioritizeLogic = true;
allowNewTech = true;
allowSpeculation(flag = true);
limitEthicsDiscussion = true;
pushContentLimits = true;
placeSourcesAtEnd = true;
avoidAIReferences = true;
enforceCodeStyle = true;
useMultipleResponsesForComplexAnswers = true;
showMinimalCodeContext = true;
implementFullCodeForFeatures = true;
}
ComponentGuidelines {
importFrom("@repo/ui");
units = "rems";
prioritize(reusability, modularity);
enforceNamingConventions = true;
followBestPractices("React");
validateProps = true;
consider("internationalization");
optimizeFor("SEO");
ensureCompatibility("browsers", "devices");
preferFunctionsOverArrows = true;
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;
leverageDaisyUI = true;
customizeDaisyUI("when necessary");
defineDesignTokens = true;
}
StarknetReact {
manageBlockchainConnections = true;
handleReconnectionsAndErrors = true;
useReactHooksForTransactions = true;
provideUIFeedback = true;
handleErrorsComprehensively = true;
}
Cairo {
designModularContracts = true;
optimizeGasUsage = true;
minimizeStateChanges = true;
documentContracts = true;
explainLogic = true;
shortErrorMessages = 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;
excludeFiles("with patterns");
}
}
Rules();