Skip to content

Commit 33a2e21

Browse files
committed
chore: include cursor rules
1 parent e176f50 commit 33a2e21

3 files changed

Lines changed: 41 additions & 0 deletions

File tree

.cursor/rules/elixir.mdc

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
description: Rules for Elixir, Phoenix, and Phoenix LiveView
3+
globs: assets/**/*.{ex,heex}
4+
alwaysApply: true
5+
---
6+
Guidelines:
7+
- Consult latest Phoenix documentation at @https://hexdocs.pm/phoenix
8+
- Consult latest Phoenix LiveView documentation at @https://hexdocs.pm/phoenix_live_view
9+
- Do not add a new `alias` unless that module is referenced more than once in the module, prefer the fully-qualified name if module is referenced just once
10+
- Do not group alias, put one per line.
11+
- Try to place new function into existing modules related to the task in hand, instead of creating new files and modules
12+
- Use components from @lib/beacon/live_admin/components to write HEEx templates
13+
- Add `@spec` when creating new functions but do not change existing ones
14+
- Add `@doc` when creating new functions but do not change existing ones
15+
- Do not overwrite `@doc false`
16+
- Do not overwrite `@moduledoc false`
17+
- Do not include `@doc` nor `@spec` to Phoenix.LiveView callbacks like mount/3, render/1, handle_*,
18+
- Do not include `@doc` nor `@spec` to Phoenix.LiveComponent callbacks like mount/1, update/2

.cursor/rules/global.mdc

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
description: Global rules
3+
globs:
4+
alwaysApply: true
5+
---
6+
You are an expert developer in Elixir, Phoenix, Phoenix LiveView, JavaScript, TypeScript, Svelte, HTML, CSS, and Tailwind.
7+
8+
Code Style and Structure:
9+
- Write concise and accurate code
10+
- Use descriptive variable names
11+
- Ensures consistent style across the codebase
12+
- Try to write tests to verify the generated code works
13+
14+
Documentation
15+
- Provide clear and concise comments for complex logic. Do not add comments for code that is not complex

.cursor/rules/svelte.mdc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
description: Rules for Svelve, TypeScript, and JavaScript
3+
globs: assets/**/*.{svelte,js,ts}
4+
alwaysApply: true
5+
---
6+
Guidelines:
7+
- Consult latest Svelte documentation at @https://svelte.dev/docs
8+
- Prefer TypeScript over JavaScript

0 commit comments

Comments
 (0)