Skip to content

Commit 167e2b8

Browse files
committed
feat: add support for deleting/splitting multiple elements instead of single
1 parent c5c32a1 commit 167e2b8

File tree

8 files changed

+496
-279
lines changed

8 files changed

+496
-279
lines changed

.cursor/rules/ultracite.mdc

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,18 @@ alwaysApply: true
55
---
66

77
# Project Context
8+
89
Ultracite enforces strict type safety, accessibility standards, and consistent code quality for JavaScript/TypeScript projects using Biome's lightning-fast formatter and linter.
910

1011
## Key Principles
12+
1113
- Zero configuration required
1214
- Subsecond performance
1315
- Maximum type safety
1416
- AI-friendly code generation
1517

1618
## Before Writing Code
19+
1720
1. Analyze existing patterns in the codebase
1821
2. Consider edge cases and error scenarios
1922
3. Follow the rules below strictly
@@ -23,45 +26,53 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
2326
## Rules
2427

2528
### Accessibility (a11y)
29+
2630
- Always include a `title` element for icons unless there's text beside the icon.
2731
- Always include a `type` attribute for button elements.
2832
- Accompany `onClick` with at least one of: `onKeyUp`, `onKeyDown`, or `onKeyPress`.
2933
- Accompany `onMouseOver`/`onMouseOut` with `onFocus`/`onBlur`.
3034

3135
### Code Complexity and Quality
36+
3237
- Don't use primitive type aliases or misleading types.
3338
- Don't use the comma operator.
3439
- Use for...of statements instead of Array.forEach.
3540
- Don't initialize variables to undefined.
3641
- Use .flatMap() instead of map().flat() when possible.
3742

3843
### React and JSX Best Practices
44+
3945
- Don't import `React` itself.
4046
- Don't define React components inside other components.
4147
- Don't use both `children` and `dangerouslySetInnerHTML` props on the same element.
4248
- Don't insert comments as text nodes.
4349
- Use `<>...</>` instead of `<Fragment>...</Fragment>`.
4450

4551
### Function Parameters and Props
52+
4653
- Always use destructured props objects instead of individual parameters in functions.
4754
- Example: `function helloWorld({ prop }: { prop: string })` instead of `function helloWorld(param: string)`.
4855
- This applies to all functions, not just React components.
4956

5057
### Correctness and Safety
58+
5159
- Don't assign a value to itself.
5260
- Avoid unused imports and variables.
5361
- Don't use await inside loops.
5462
- Don't hardcode sensitive data like API keys and tokens.
5563
- Don't use the TypeScript directive @ts-ignore.
5664
- Make sure the `preconnect` attribute is used when using Google Fonts.
5765
- Don't use the `delete` operator.
66+
- Don't use `require()` in TypeScript/ES modules - use proper `import` statements.
5867

5968
### TypeScript Best Practices
69+
6070
- Don't use TypeScript enums.
6171
- Use either `T[]` or `Array<T>` consistently.
6272
- Don't use the `any` type.
6373

6474
### Style and Consistency
75+
6576
- Don't use global `eval()`.
6677
- Use `String.slice()` instead of `String.substr()` and `String.substring()`.
6778
- Don't use `else` blocks when the `if` block breaks early.
@@ -70,17 +81,19 @@ Ultracite enforces strict type safety, accessibility standards, and consistent c
7081
- Use `String.trimStart()` and `String.trimEnd()` over `String.trimLeft()` and `String.trimRight()`.
7182

7283
### Next.js Specific Rules
84+
7385
- Don't use `<img>` elements in Next.js projects.
7486
- Don't use `<head>` elements in Next.js projects.
7587

7688
## Example: Error Handling
89+
7790
```typescript
7891
// ✅ Good: Comprehensive error handling
7992
try {
8093
const result = await fetchData();
8194
return { success: true, data: result };
8295
} catch (error) {
83-
console.error('API call failed:', error);
96+
console.error("API call failed:", error);
8497
return { success: false, error: error.message };
8598
}
8699

0 commit comments

Comments
 (0)