Skip to content

Commit a0e9349

Browse files
committed
Adds js to file paths and fixes typos
1 parent a6e85f0 commit a0e9349

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

.cursor/rules/writing-tasks.mdc

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
description: Guidelines for writing Trigger.dev tasks
3-
globs: **/trigger/**/*.ts, **/trigger/**/*.tsx
3+
globs: **/trigger/**/*.ts, **/trigger/**/*.tsx,**/trigger/**/*.js,**/trigger/**/*.jsx
44
alwaysApply: false
55
---
66
# How to write Trigger.dev tasks
@@ -832,7 +832,7 @@ npm add @trigger.dev/react-hooks
832832

833833
All hooks require a Public Access Token. You can provide it directly to each hook:
834834

835-
```typescriptx
835+
```typescript
836836
import { useRealtimeRun } from "@trigger.dev/react-hooks";
837837

838838
function MyComponent({ runId, publicAccessToken }) {
@@ -845,7 +845,7 @@ function MyComponent({ runId, publicAccessToken }) {
845845

846846
Or use the `TriggerAuthContext` provider:
847847

848-
```typescriptx
848+
```typescript
849849
import { TriggerAuthContext } from "@trigger.dev/react-hooks";
850850

851851
function SetupTrigger({ publicAccessToken }) {
@@ -859,7 +859,7 @@ function SetupTrigger({ publicAccessToken }) {
859859

860860
For Next.js App Router, wrap the provider in a client component:
861861

862-
```typescriptx
862+
```typescript
863863
// components/TriggerProvider.tsx
864864
"use client";
865865

@@ -879,7 +879,7 @@ export function TriggerProvider({ accessToken, children }) {
879879
Several approaches for Next.js App Router:
880880

881881
1. **Using cookies**:
882-
```typescriptx
882+
```typescript
883883
// Server action
884884
export async function startRun() {
885885
const handle = await tasks.trigger<typeof exampleTask>("example", { foo: "bar" });
@@ -899,7 +899,7 @@ export default function RunPage({ params }) {
899899
```
900900

901901
2. **Using query parameters**:
902-
```typescriptx
902+
```typescript
903903
// Server action
904904
export async function startRun() {
905905
const handle = await tasks.trigger<typeof exampleTask>("example", { foo: "bar" });
@@ -908,7 +908,7 @@ export async function startRun() {
908908
```
909909

910910
3. **Server-side token generation**:
911-
```typescriptx
911+
```typescript
912912
// Page component
913913
export default async function RunPage({ params }) {
914914
const publicAccessToken = await generatePublicAccessToken(params.id);
@@ -938,7 +938,7 @@ export async function generatePublicAccessToken(runId: string) {
938938

939939
Data fetching hooks that use SWR for caching:
940940

941-
```typescriptx
941+
```typescript
942942
"use client";
943943
import { useRun } from "@trigger.dev/react-hooks";
944944
import type { myTask } from "@/trigger/myTask";

0 commit comments

Comments
 (0)