nursery/noConvexOldRegisteredFunctionSyntax
nursery · since 2.6.10
Unsafe autofixRecommended
biome.json
{
"linter": {
"rules": {
"nursery": {
"noConvexOldRegisteredFunctionSyntax": "error"
}
}
}
}Require the object syntax when registering Convex queries, mutations, and actions.
export const list = query(async (ctx) => {
return await ctx.db.query("messages").collect();
});export const send = mutation(async (ctx, { body }) => {
await ctx.db.insert("messages", { body });
});export const list = query({
args: {},
handler: async (ctx) => {
return await ctx.db.query("messages").collect();
},
});
export const send = mutation({
args: { body: v.string() },
handler: async (ctx, { body }) => {
await ctx.db.insert("messages", { body });
},
});Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/noConvexOldRegisteredFunctionSyntax
nursery · since 2.6.10
{
"linter": {
"rules": {
"nursery": {
"noConvexOldRegisteredFunctionSyntax": "error"
}
}
}
}Disallow Convex database indexes whose fields are the first fields of another index on the same table.
Disallow calling .filter() on a Convex database query.
Disallow ineffective ordering in files.includes patterns.
Disallow reading the current time or generating random values in Convex queries.