chore: ignore convex generated files in lint config
- commit
- 81f4cf8c2c63bc34bd06852500de8a2f8c8a1209
- author
- bnema · · 2026-01-18 20:57 UTC
- parent
- 89bb389
- signature
- GPG Verified
CD88F9E564E0102646FB6077A1A07C7C7C3E349D· arch-gpg Verified for the committer email
4 files · +76 -71
M .prettierignore +4 -0
| @@ -2,3 +2,7 @@ | |||
| 2 | 2 | package-lock.json | |
| 3 | 3 | pnpm-lock.yaml | |
| 4 | 4 | yarn.lock | |
| 5 | + | ||
| 6 | + | # Auto-generated files | |
| 7 | + | src/convex/_generated/ | |
| 8 | + | .claude/ | |
| @@ -2,3 +2,7 @@ | |||||
| 2 | package-lock.json | 2 | package-lock.json | ||
| 3 | pnpm-lock.yaml | 3 | pnpm-lock.yaml | ||
| 4 | yarn.lock | 4 | yarn.lock | ||
| 5 | + | ||||
| 6 | + | # Auto-generated files | |||
| 7 | + | src/convex/_generated/ | |||
| 8 | + | .claude/ | |||
M eslint.config.js +3 -0
| @@ -9,6 +9,9 @@ const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); | |||
| 9 | 9 | ||
| 10 | 10 | export default ts.config( | |
| 11 | 11 | includeIgnoreFile(gitignorePath), | |
| 12 | + | { | |
| 13 | + | ignores: ['src/convex/_generated/**'] | |
| 14 | + | }, | |
| 12 | 15 | js.configs.recommended, | |
| 13 | 16 | ...ts.configs.recommended, | |
| 14 | 17 | ...svelte.configs['flat/recommended'], | |
| @@ -9,6 +9,9 @@ const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url)); | |||||
| 9 | 9 | ||||
| 10 | export default ts.config( | 10 | export default ts.config( | ||
| 11 | includeIgnoreFile(gitignorePath), | 11 | includeIgnoreFile(gitignorePath), | ||
| 12 | + | { | |||
| 13 | + | ignores: ['src/convex/_generated/**'] | |||
| 14 | + | }, | |||
| 12 | js.configs.recommended, | 15 | js.configs.recommended, | ||
| 13 | ...ts.configs.recommended, | 16 | ...ts.configs.recommended, | ||
| 14 | ...svelte.configs['flat/recommended'], | 17 | ...svelte.configs['flat/recommended'], | ||
M src/convex/README.md +47 -49
| @@ -7,29 +7,29 @@ A query function that takes two arguments looks like: | |||
| 7 | 7 | ||
| 8 | 8 | ```ts | |
| 9 | 9 | // convex/myFunctions.ts | |
| 10 | - | import { query } from "./_generated/server"; | |
| 11 | - | import { v } from "convex/values"; | |
| 10 | + | import { query } from './_generated/server'; | |
| 11 | + | import { v } from 'convex/values'; | |
| 12 | 12 | ||
| 13 | 13 | export const myQueryFunction = query({ | |
| 14 | - | // Validators for arguments. | |
| 15 | - | args: { | |
| 16 | - | first: v.number(), | |
| 17 | - | second: v.string(), | |
| 18 | - | }, | |
| 19 | - | ||
| 20 | - | // Function implementation. | |
| 21 | - | handler: async (ctx, args) => { | |
| 22 | - | // Read the database as many times as you need here. | |
| 23 | - | // See https://docs.convex.dev/database/reading-data. | |
| 24 | - | const documents = await ctx.db.query("tablename").collect(); | |
| 25 | - | ||
| 26 | - | // Arguments passed from the client are properties of the args object. | |
| 27 | - | console.log(args.first, args.second); | |
| 28 | - | ||
| 29 | - | // Write arbitrary JavaScript here: filter, aggregate, build derived data, | |
| 30 | - | // remove non-public properties, or create new objects. | |
| 31 | - | return documents; | |
| 32 | - | }, | |
| 14 | + | // Validators for arguments. | |
| 15 | + | args: { | |
| 16 | + | first: v.number(), | |
| 17 | + | second: v.string() | |
| 18 | + | }, | |
| 19 | + | ||
| 20 | + | // Function implementation. | |
| 21 | + | handler: async (ctx, args) => { | |
| 22 | + | // Read the database as many times as you need here. | |
| 23 | + | // See https://docs.convex.dev/database/reading-data. | |
| 24 | + | const documents = await ctx.db.query('tablename').collect(); | |
| 25 | + | ||
| 26 | + | // Arguments passed from the client are properties of the args object. | |
| 27 | + | console.log(args.first, args.second); | |
| 28 | + | ||
| 29 | + | // Write arbitrary JavaScript here: filter, aggregate, build derived data, | |
| 30 | + | // remove non-public properties, or create new objects. | |
| 31 | + | return documents; | |
| 32 | + | } | |
| 33 | 33 | }); | |
| 34 | 34 | ``` | |
| 35 | 35 | ||
| @@ -37,8 +37,8 @@ Using this query function in a React component looks like: | |||
| 37 | 37 | ||
| 38 | 38 | ```ts | |
| 39 | 39 | const data = useQuery(api.myFunctions.myQueryFunction, { | |
| 40 | - | first: 10, | |
| 41 | - | second: "hello", | |
| 40 | + | first: 10, | |
| 41 | + | second: 'hello' | |
| 42 | 42 | }); | |
| 43 | 43 | ``` | |
| 44 | 44 | ||
| @@ -46,27 +46,27 @@ A mutation function looks like: | |||
| 46 | 46 | ||
| 47 | 47 | ```ts | |
| 48 | 48 | // convex/myFunctions.ts | |
| 49 | - | import { mutation } from "./_generated/server"; | |
| 50 | - | import { v } from "convex/values"; | |
| 49 | + | import { mutation } from './_generated/server'; | |
| 50 | + | import { v } from 'convex/values'; | |
| 51 | 51 | ||
| 52 | 52 | export const myMutationFunction = mutation({ | |
| 53 | - | // Validators for arguments. | |
| 54 | - | args: { | |
| 55 | - | first: v.string(), | |
| 56 | - | second: v.string(), | |
| 57 | - | }, | |
| 58 | - | ||
| 59 | - | // Function implementation. | |
| 60 | - | handler: async (ctx, args) => { | |
| 61 | - | // Insert or modify documents in the database here. | |
| 62 | - | // Mutations can also read from the database like queries. | |
| 63 | - | // See https://docs.convex.dev/database/writing-data. | |
| 64 | - | const message = { body: args.first, author: args.second }; | |
| 65 | - | const id = await ctx.db.insert("messages", message); | |
| 66 | - | ||
| 67 | - | // Optionally, return a value from your mutation. | |
| 68 | - | return await ctx.db.get("messages", id); | |
| 69 | - | }, | |
| 53 | + | // Validators for arguments. | |
| 54 | + | args: { | |
| 55 | + | first: v.string(), | |
| 56 | + | second: v.string() | |
| 57 | + | }, | |
| 58 | + | ||
| 59 | + | // Function implementation. | |
| 60 | + | handler: async (ctx, args) => { | |
| 61 | + | // Insert or modify documents in the database here. | |
| 62 | + | // Mutations can also read from the database like queries. | |
| 63 | + | // See https://docs.convex.dev/database/writing-data. | |
| 64 | + | const message = { body: args.first, author: args.second }; | |
| 65 | + | const id = await ctx.db.insert('messages', message); | |
| 66 | + | ||
| 67 | + | // Optionally, return a value from your mutation. | |
| 68 | + | return await ctx.db.get('messages', id); | |
| 69 | + | } | |
| 70 | 70 | }); | |
| 71 | 71 | ``` | |
| 72 | 72 | ||
| @@ -75,13 +75,11 @@ Using this mutation function in a React component looks like: | |||
| 75 | 75 | ```ts | |
| 76 | 76 | const mutation = useMutation(api.myFunctions.myMutationFunction); | |
| 77 | 77 | function handleButtonPress() { | |
| 78 | - | // fire and forget, the most common way to use mutations | |
| 79 | - | mutation({ first: "Hello!", second: "me" }); | |
| 80 | - | // OR | |
| 81 | - | // use the result once the mutation has completed | |
| 82 | - | mutation({ first: "Hello!", second: "me" }).then((result) => | |
| 83 | - | console.log(result), | |
| 84 | - | ); | |
| 78 | + | // fire and forget, the most common way to use mutations | |
| 79 | + | mutation({ first: 'Hello!', second: 'me' }); | |
| 80 | + | // OR | |
| 81 | + | // use the result once the mutation has completed | |
| 82 | + | mutation({ first: 'Hello!', second: 'me' }).then((result) => console.log(result)); | |
| 85 | 83 | } | |
| 86 | 84 | ``` | |
| 87 | 85 | ||
| @@ -7,29 +7,29 @@ A query function that takes two arguments looks like: | |||||
| 7 | 7 | ||||
| 8 | ```ts | 8 | ```ts | ||
| 9 | // convex/myFunctions.ts | 9 | // convex/myFunctions.ts | ||
| 10 | - | import { query } from "./_generated/server"; | 10 | + | import { query } from './_generated/server'; |
| 11 | - | import { v } from "convex/values"; | 11 | + | import { v } from 'convex/values'; |
| 12 | 12 | ||||
| 13 | export const myQueryFunction = query({ | 13 | export const myQueryFunction = query({ | ||
| 14 | - | // Validators for arguments. | 14 | + | // Validators for arguments. |
| 15 | - | args: { | 15 | + | args: { |
| 16 | - | first: v.number(), | 16 | + | first: v.number(), |
| 17 | - | second: v.string(), | 17 | + | second: v.string() |
| 18 | - | }, | 18 | + | }, |
| 19 | - | 19 | + | ||
| 20 | - | // Function implementation. | 20 | + | // Function implementation. |
| 21 | - | handler: async (ctx, args) => { | 21 | + | handler: async (ctx, args) => { |
| 22 | - | // Read the database as many times as you need here. | 22 | + | // Read the database as many times as you need here. |
| 23 | - | // See https://docs.convex.dev/database/reading-data. | 23 | + | // See https://docs.convex.dev/database/reading-data. |
| 24 | - | const documents = await ctx.db.query("tablename").collect(); | 24 | + | const documents = await ctx.db.query('tablename').collect(); |
| 25 | - | 25 | + | ||
| 26 | - | // Arguments passed from the client are properties of the args object. | 26 | + | // Arguments passed from the client are properties of the args object. |
| 27 | - | console.log(args.first, args.second); | 27 | + | console.log(args.first, args.second); |
| 28 | - | 28 | + | ||
| 29 | - | // Write arbitrary JavaScript here: filter, aggregate, build derived data, | 29 | + | // Write arbitrary JavaScript here: filter, aggregate, build derived data, |
| 30 | - | // remove non-public properties, or create new objects. | 30 | + | // remove non-public properties, or create new objects. |
| 31 | - | return documents; | 31 | + | return documents; |
| 32 | - | }, | 32 | + | } |
| 33 | }); | 33 | }); | ||
| 34 | ``` | 34 | ``` | ||
| 35 | 35 | ||||
| @@ -37,8 +37,8 @@ Using this query function in a React component looks like: | |||||
| 37 | 37 | ||||
| 38 | ```ts | 38 | ```ts | ||
| 39 | const data = useQuery(api.myFunctions.myQueryFunction, { | 39 | const data = useQuery(api.myFunctions.myQueryFunction, { | ||
| 40 | - | first: 10, | 40 | + | first: 10, |
| 41 | - | second: "hello", | 41 | + | second: 'hello' |
| 42 | }); | 42 | }); | ||
| 43 | ``` | 43 | ``` | ||
| 44 | 44 | ||||
| @@ -46,27 +46,27 @@ A mutation function looks like: | |||||
| 46 | 46 | ||||
| 47 | ```ts | 47 | ```ts | ||
| 48 | // convex/myFunctions.ts | 48 | // convex/myFunctions.ts | ||
| 49 | - | import { mutation } from "./_generated/server"; | 49 | + | import { mutation } from './_generated/server'; |
| 50 | - | import { v } from "convex/values"; | 50 | + | import { v } from 'convex/values'; |
| 51 | 51 | ||||
| 52 | export const myMutationFunction = mutation({ | 52 | export const myMutationFunction = mutation({ | ||
| 53 | - | // Validators for arguments. | 53 | + | // Validators for arguments. |
| 54 | - | args: { | 54 | + | args: { |
| 55 | - | first: v.string(), | 55 | + | first: v.string(), |
| 56 | - | second: v.string(), | 56 | + | second: v.string() |
| 57 | - | }, | 57 | + | }, |
| 58 | - | 58 | + | ||
| 59 | - | // Function implementation. | 59 | + | // Function implementation. |
| 60 | - | handler: async (ctx, args) => { | 60 | + | handler: async (ctx, args) => { |
| 61 | - | // Insert or modify documents in the database here. | 61 | + | // Insert or modify documents in the database here. |
| 62 | - | // Mutations can also read from the database like queries. | 62 | + | // Mutations can also read from the database like queries. |
| 63 | - | // See https://docs.convex.dev/database/writing-data. | 63 | + | // See https://docs.convex.dev/database/writing-data. |
| 64 | - | const message = { body: args.first, author: args.second }; | 64 | + | const message = { body: args.first, author: args.second }; |
| 65 | - | const id = await ctx.db.insert("messages", message); | 65 | + | const id = await ctx.db.insert('messages', message); |
| 66 | - | 66 | + | ||
| 67 | - | // Optionally, return a value from your mutation. | 67 | + | // Optionally, return a value from your mutation. |
| 68 | - | return await ctx.db.get("messages", id); | 68 | + | return await ctx.db.get('messages', id); |
| 69 | - | }, | 69 | + | } |
| 70 | }); | 70 | }); | ||
| 71 | ``` | 71 | ``` | ||
| 72 | 72 | ||||
| @@ -75,13 +75,11 @@ Using this mutation function in a React component looks like: | |||||
| 75 | ```ts | 75 | ```ts | ||
| 76 | const mutation = useMutation(api.myFunctions.myMutationFunction); | 76 | const mutation = useMutation(api.myFunctions.myMutationFunction); | ||
| 77 | function handleButtonPress() { | 77 | function handleButtonPress() { | ||
| 78 | - | // fire and forget, the most common way to use mutations | 78 | + | // fire and forget, the most common way to use mutations |
| 79 | - | mutation({ first: "Hello!", second: "me" }); | 79 | + | mutation({ first: 'Hello!', second: 'me' }); |
| 80 | - | // OR | 80 | + | // OR |
| 81 | - | // use the result once the mutation has completed | 81 | + | // use the result once the mutation has completed |
| 82 | - | mutation({ first: "Hello!", second: "me" }).then((result) => | 82 | + | mutation({ first: 'Hello!', second: 'me' }).then((result) => console.log(result)); |
| 83 | - | console.log(result), | |||
| 84 | - | ); | |||
| 85 | } | 83 | } | ||
| 86 | ``` | 84 | ``` | ||
| 87 | 85 | ||||
M src/convex/tsconfig.json +22 -22
| @@ -1,25 +1,25 @@ | |||
| 1 | 1 | { | |
| 2 | - | /* This TypeScript project config describes the environment that | |
| 3 | - | * Convex functions run in and is used to typecheck them. | |
| 4 | - | * You can modify it, but some settings are required to use Convex. | |
| 5 | - | */ | |
| 6 | - | "compilerOptions": { | |
| 7 | - | /* These settings are not required by Convex and can be modified. */ | |
| 8 | - | "allowJs": true, | |
| 9 | - | "strict": true, | |
| 10 | - | "moduleResolution": "Bundler", | |
| 11 | - | "jsx": "react-jsx", | |
| 12 | - | "skipLibCheck": true, | |
| 13 | - | "allowSyntheticDefaultImports": true, | |
| 2 | + | /* This TypeScript project config describes the environment that | |
| 3 | + | * Convex functions run in and is used to typecheck them. | |
| 4 | + | * You can modify it, but some settings are required to use Convex. | |
| 5 | + | */ | |
| 6 | + | "compilerOptions": { | |
| 7 | + | /* These settings are not required by Convex and can be modified. */ | |
| 8 | + | "allowJs": true, | |
| 9 | + | "strict": true, | |
| 10 | + | "moduleResolution": "Bundler", | |
| 11 | + | "jsx": "react-jsx", | |
| 12 | + | "skipLibCheck": true, | |
| 13 | + | "allowSyntheticDefaultImports": true, | |
| 14 | 14 | ||
| 15 | - | /* These compiler options are required by Convex */ | |
| 16 | - | "target": "ESNext", | |
| 17 | - | "lib": ["ES2021", "dom"], | |
| 18 | - | "forceConsistentCasingInFileNames": true, | |
| 19 | - | "module": "ESNext", | |
| 20 | - | "isolatedModules": true, | |
| 21 | - | "noEmit": true | |
| 22 | - | }, | |
| 23 | - | "include": ["./**/*"], | |
| 24 | - | "exclude": ["./_generated"] | |
| 15 | + | /* These compiler options are required by Convex */ | |
| 16 | + | "target": "ESNext", | |
| 17 | + | "lib": ["ES2021", "dom"], | |
| 18 | + | "forceConsistentCasingInFileNames": true, | |
| 19 | + | "module": "ESNext", | |
| 20 | + | "isolatedModules": true, | |
| 21 | + | "noEmit": true | |
| 22 | + | }, | |
| 23 | + | "include": ["./**/*"], | |
| 24 | + | "exclude": ["./_generated"] | |
| 25 | 25 | } | |
| @@ -1,25 +1,25 @@ | |||||
| 1 | { | 1 | { | ||
| 2 | - | /* This TypeScript project config describes the environment that | 2 | + | /* This TypeScript project config describes the environment that |
| 3 | - | * Convex functions run in and is used to typecheck them. | 3 | + | * Convex functions run in and is used to typecheck them. |
| 4 | - | * You can modify it, but some settings are required to use Convex. | 4 | + | * You can modify it, but some settings are required to use Convex. |
| 5 | - | */ | 5 | + | */ |
| 6 | - | "compilerOptions": { | 6 | + | "compilerOptions": { |
| 7 | - | /* These settings are not required by Convex and can be modified. */ | 7 | + | /* These settings are not required by Convex and can be modified. */ |
| 8 | - | "allowJs": true, | 8 | + | "allowJs": true, |
| 9 | - | "strict": true, | 9 | + | "strict": true, |
| 10 | - | "moduleResolution": "Bundler", | 10 | + | "moduleResolution": "Bundler", |
| 11 | - | "jsx": "react-jsx", | 11 | + | "jsx": "react-jsx", |
| 12 | - | "skipLibCheck": true, | 12 | + | "skipLibCheck": true, |
| 13 | - | "allowSyntheticDefaultImports": true, | 13 | + | "allowSyntheticDefaultImports": true, |
| 14 | 14 | ||||
| 15 | - | /* These compiler options are required by Convex */ | 15 | + | /* These compiler options are required by Convex */ |
| 16 | - | "target": "ESNext", | 16 | + | "target": "ESNext", |
| 17 | - | "lib": ["ES2021", "dom"], | 17 | + | "lib": ["ES2021", "dom"], |
| 18 | - | "forceConsistentCasingInFileNames": true, | 18 | + | "forceConsistentCasingInFileNames": true, |
| 19 | - | "module": "ESNext", | 19 | + | "module": "ESNext", |
| 20 | - | "isolatedModules": true, | 20 | + | "isolatedModules": true, |
| 21 | - | "noEmit": true | 21 | + | "noEmit": true |
| 22 | - | }, | 22 | + | }, |
| 23 | - | "include": ["./**/*"], | 23 | + | "include": ["./**/*"], |
| 24 | - | "exclude": ["./_generated"] | 24 | + | "exclude": ["./_generated"] |
| 25 | } | 25 | } | ||