DenisB
DenisB
CCConvex Community
Created by DenisB on 5/12/2025 in #support-community
Linting of convex TS files is very slow - 7 seconds per file
Get this in VSCode:
[Warn - 9:39:59 PM] Linting file file:///home/den/work/convex-test1/convex/db/users.ts took 7439ms. Please check the ESLint rules for performance issues.
[Warn - 9:39:59 PM] Linting file file:///home/den/work/convex-test1/convex/db/users.ts took 7439ms. Please check the ESLint rules for performance issues.
Output of eslint with --debug: ... eslint:eslint Lint /home/den/work/convex-test1/convex/db/users.ts +3ms eslint:linter Linting code for /home/den/work/convex-test1/convex/db/users.ts (pass 1) +0ms eslint:linter Verify +0ms eslint:linter With flat config: /home/den/work/convex-test1/convex/db/users.ts +0ms eslint:languages:js Parsing: /home/den/work/convex-test1/convex/db/users.ts +0ms eslint:languages:js Parsing successful: /home/den/work/convex-test1/convex/db/users.ts +2s (!!!!) eslint:languages:js Scope analysis: /home/den/work/convex-test1/convex/db/users.ts +1ms eslint:languages:js Scope analysis successful: /home/den/work/convex-test1/convex/db/users.ts +0ms eslint:linter Generating fixed text for /home/den/work/convex-test1/convex/db/users.ts (pass 1) +4s (!!!!) eslint:source-code-fixer Applying fixes +0ms eslint:source-code-fixer shouldFix parameter was false, not attempting fixes +1ms ... Is it possible to improve linting speed for convex TS files? Code: https://playcode.io/2379520
4 replies
CCConvex Community
Created by DenisB on 4/29/2025 in #support-community
How to use Zod for validating database writes?
I read in https://stack.convex.dev/typescript-zod-function-validation that it is possible to define a Zod schema and validate all database writes/updates using Zod. The article mentioned that, in order to do this, ctx.db must be wrapped. Does anyone have an example of how to do this? I tried to understand how rowLevelSecurity works (as it was mentioned in the article), but it seems to be beyond my comprehension. For example, I want the field of an object in db be validated like z.number().int().gt(0).safe()
13 replies