Something went wrong. Try again.
Cursor plugin specification and official plugins
Something went wrong. Try again.
872 B · 36 lines
12345678910111213141516171819202122232425262728293031323334353637---description: Example rule demonstrating Cursor rule structureglobs: - "**/*.ts" - "**/*.tsx"alwaysApply: false---
# Example Coding Standards
When working with TypeScript files, follow these conventions:
1. **Use explicit types** - Avoid `any` unless absolutely necessary2. **Prefer `const` over `let`** - Use immutable bindings when possible3. **Use async/await** - Prefer async/await over raw Promises4. **Handle errors explicitly** - Always catch and handle errors appropriately
## Example
```typescript// ✅ Goodconst fetchData = async (id: string): Promise<Data> => { try { const response = await api.get(`/data/${id}`); return response.data; } catch (error) { console.error('Failed to fetch data:', error); throw error; }};
// ❌ Badconst fetchData = (id) => { return api.get('/data/' + id).then(r => r.data);};```