Skip to content

Commit b79202d

Browse files
committed
lint
1 parent f18b9f0 commit b79202d

28 files changed

+94
-71
lines changed

convex/example.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,10 @@ describe("testingExample", () => {
1717
expect(await t.query(api.counter.getCounter, { counterName: "foo" })).toBe(
1818
0,
1919
);
20-
expect(() =>
20+
await expect(
2121
t.query(api.counter.getCounterOrThrow, { counterName: "foo" }),
2222
).rejects.toThrow(/Counter not found/);
23-
expect(() =>
23+
await expect(() =>
2424
t.query(api.counter.getCounterOrThrow, { counterName: "bar" }),
2525
).rejects.toThrow(/Counter not found/);
2626
await t.mutation(api.counter.incrementCounter, {

convex/migrationsExample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ export const cleanUpBrokenRefs = migration({
4040

4141
export const callOneDirectly = internalMutation({
4242
args: {},
43-
handler: async (ctx, args) => {
43+
handler: async (ctx, _args) => {
4444
// can run a migration directly within a function:
4545
await startMigration(ctx, internal.migrationsExample.increment, {
4646
startCursor: null,

convex/retriesExample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ export const unreliableAction = internalAction({
2828
// e.g. `npx convex run retriesExample:runUnreliableActionWithRetries`
2929
export const runUnreliableActionWithRetries = mutation({
3030
args: {},
31-
handler: async (ctx, args) => {
31+
handler: async (ctx, _args) => {
3232
await runWithRetries(ctx, internal.retriesExample.unreliableAction, {
3333
failureRate: 0.8,
3434
});

convex/sessionsExample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export const logIn = mutationWithSession({
138138

139139
export const logOut = mutationWithSession({
140140
args: {},
141-
handler: async (ctx, args) => {
141+
handler: async (ctx, _args) => {
142142
console.log("deleting presence data on logout", ctx.sessionId);
143143
const presenceDocs = await ctx.db
144144
.query("presence")

convex/triggersExample.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export const incrementCounterRace = mutation({
9797

9898
export const getSum = query({
9999
args: {},
100-
handler: async (ctx, args) => {
100+
handler: async (ctx, _args) => {
101101
return ctx.db.query("sum_table").first();
102102
},
103103
});

eslint.config.mjs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,16 @@ import reactPlugin from "eslint-plugin-react";
55
import reactHooks from "eslint-plugin-react-hooks";
66

77
export default [
8-
{ files: ["src/**/*.{js,mjs,cjs,ts,tsx}"] },
8+
{ files: ["src/**/*.{js,mjs,cjs,ts,tsx}", "convex/**/*.{ts,tsx}"] },
99
{
1010
ignores: [
1111
"dist/**",
12+
"packages/convex-helpers/dist/**",
13+
"packages/convex-helpers/generate-exports.mjs",
14+
"src/fakeConvexClient/fakeConvexClient.js",
15+
"backendHarness.js",
1216
"eslint.config.mjs",
17+
"convex/vitest.config.mts",
1318
"setup.cjs",
1419
"**/_generated/",
1520
"vite.config.mts",

packages/convex-helpers/cli/openApiSpec.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test("generateValidSpec", async () => {
2323
const testFileName = "openApiSpec.test.yaml";
2424
fs.writeFileSync(testFileName, apiSpec, "utf-8");
2525

26-
let output = execSync(`npx redocly lint ${testFileName} --format='json'`);
26+
const output = execSync(`npx redocly lint ${testFileName} --format='json'`);
2727

2828
fs.unlinkSync(testFileName);
2929

packages/convex-helpers/cli/openApiSpec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ export const openApiSpec = new Command("open-api-spec")
3535
).default(undefined),
3636
)
3737
.action(async (options) => {
38-
let content = getFunctionSpec(options.prod, options.inputFile);
38+
const content = getFunctionSpec(options.prod, options.inputFile);
3939
const outputPath =
4040
(options.outputFile ?? `convex-spec-${Date.now().valueOf()}`) + ".yaml";
4141

packages/convex-helpers/cli/tsApiSpec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export const tsApiSpec = new Command("ts-api-spec")
3737
).default(false),
3838
)
3939
.action(async (options) => {
40-
let content = getFunctionSpec(options.prod, options.inputFile);
40+
const content = getFunctionSpec(options.prod, options.inputFile);
4141
const outputPath =
4242
(options.outputFile ?? `convexApi${Date.now().valueOf()}`) + ".ts";
4343

packages/convex-helpers/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,9 +114,9 @@ export function withoutSystemFields<T extends Record<string, any>>(obj: T) {
114114
}
115115

116116
// Type utils:
117-
const error = Symbol();
117+
const _error = Symbol();
118118
export type ErrorMessage<Reason extends string> = Reason & {
119-
__error: typeof error;
119+
__error: typeof _error;
120120
};
121121

122122
// Copied from convex/server since it wasn't exported

0 commit comments

Comments
 (0)