Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import pluginJs from "@eslint/js";
import tseslint from "typescript-eslint";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import convexPlugin from "@convex-dev/eslint-plugin";

export default [
{
Expand Down Expand Up @@ -38,7 +39,12 @@ export default [
languageOptions: {
globals: globals.worker,
},
plugins: {
"@convex-dev": convexPlugin,
},
rules: {
...convexPlugin.configs.recommended[0].rules,

"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/no-explicit-any": "off",
"no-unused-vars": "off",
Expand Down
4 changes: 2 additions & 2 deletions example/convex/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const { authKitEvent } = authKit.events({
console.warn(`User not found: ${event.data.id}`);
return;
}
await ctx.db.patch(user._id, {
await ctx.db.patch("users", user._id, {
email: event.data.email,
name: `${event.data.firstName} ${event.data.lastName}`,
});
Expand All @@ -55,7 +55,7 @@ export const { authKitEvent } = authKit.events({
console.warn(`User not found: ${event.data.id}`);
return;
}
await ctx.db.delete(user._id);
await ctx.db.delete("users", user._id);
},

// Handle any event type
Expand Down
4 changes: 2 additions & 2 deletions src/component/backfill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export const backfillOnComplete = internalMutation({
console.error(`Backfill workflow ${args.result.kind}`, args.result);
const backfillState = await ctx.db.query("backfillState").unique();
if (backfillState) {
await ctx.db.delete(backfillState._id);
await ctx.db.delete("backfillState", backfillState._id);
}
return null;
}
Expand All @@ -170,7 +170,7 @@ export const backfillOnComplete = internalMutation({
if (returnValue.done || !returnValue.cursor) {
const backfillState = await ctx.db.query("backfillState").unique();
if (backfillState) {
await ctx.db.delete(backfillState._id);
await ctx.db.delete("backfillState", backfillState._id);
}
} else {
await workflow.start(
Expand Down
4 changes: 2 additions & 2 deletions src/component/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ async function processEventHandler(
console.warn(`user already updated for event ${event.id}, skipping`);
return;
}
await ctx.db.patch(user._id, data);
await ctx.db.patch("users", user._id, data);
break;
}
case "user.deleted": {
Expand All @@ -93,7 +93,7 @@ async function processEventHandler(
console.warn("user not found", data.id);
return;
}
await ctx.db.delete(user._id);
await ctx.db.delete("users", user._id);
break;
}
}
Expand Down
Loading