You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: .cursor/rules/ultracite.mdc
+14-1Lines changed: 14 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -5,15 +5,18 @@ alwaysApply: true
5
5
---
6
6
7
7
# Project Context
8
+
8
9
Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
9
10
10
11
## Key Principles
12
+
11
13
- Zero configuration required
12
14
- Subsecond performance
13
15
- Maximum type safety
14
16
- AI-friendly code generation
15
17
16
18
## Before Writing Code
19
+
17
20
1. Analyze existing patterns in the codebase
18
21
2. Consider edge cases and error scenarios
19
22
3. Follow the rules below strictly
@@ -23,45 +26,53 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
23
26
## Rules
24
27
25
28
### Accessibility (a11y)
29
+
26
30
- Always include a `title` element for icons unless there's text beside the icon.
27
31
- Always include a `type` attribute for button elements.
28
32
- Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.
29
33
- Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.
30
34
31
35
### Code Complexity and Quality
36
+
32
37
- Don't use primitive type aliases or misleading types.
33
38
- Don't use the comma operator.
34
39
- Use for...of statements instead of Array.forEach.
35
40
- Don't initialize variables to undefined.
36
41
- Use .flatMap() instead of map().flat() when possible.
37
42
38
43
### React and JSX Best Practices
44
+
39
45
- Don't import `React` itself.
40
46
- Don't define React components inside other components.
41
47
- Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.
42
48
- Don't insert comments as text nodes.
43
49
- Use `<>...</>` instead of `<Fragment>...</Fragment>`.
44
50
45
51
### Function Parameters and Props
52
+
46
53
- Always use destructured props objects instead of individual parameters in functions.
0 commit comments