Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 7 potential issues.
Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.
| expandSchemaProperty(schemaFromState, schemaFromState) ?? | ||
| schemaFromState; | ||
| this.laxSchema = makeSchemaLax(this.schema); | ||
| } |
There was a problem hiding this comment.
Schema caching broken - originalSchema never updated
Medium Severity
The doComplete method compares this.originalSchema !== schemaFromState to determine if the schema changed and needs reprocessing, but this.originalSchema is never updated after the comparison. This means the condition will always be true (after the first call with a non-null schema), causing expandSchemaProperty and makeSchemaLax to run on every completion request instead of only when the schema actually changes. This defeats the intended caching optimization and may cause performance issues with large schemas.
| } else { | ||
| const [newKey, newValue] = replacement as [string | symbol, unknown]; | ||
| handleReplacementEntry(key, value, newKey, newValue); | ||
| } |
There was a problem hiding this comment.
Empty array return not handled in property replacer
Medium Severity
The replacePropertiesDeeply function doesn't handle the case when PropertyReplacer returns an empty array [] to indicate a property should be removed. When makeSchemaLax returns [] to remove properties like additionalProperties or required, the code checks Array.isArray(replacement[0]) which is false for an empty array, then destructures [] resulting in undefined for both key and value. This causes newObject[undefined] = undefined to be set instead of omitting the property entirely.
Additional Locations (1)
| const result = `\`${value}\``; | ||
| if (i === arr.length - 1) return "or " + result; | ||
| return result; | ||
| }); |
There was a problem hiding this comment.
Single-element array produces incorrect "or" prefix
Low Severity
The joinWithOr function incorrectly prefixes "or" to the last element regardless of array length. When the array has only one element (where i === 0 === arr.length - 1), the result becomes "or \value`"instead of just"`value`". This causes grammatically incorrect output like "Expected one of or string" in validation error messages and "oneOf: or string`" in hover tooltips when there's only one type in a union.
| extends: ["@knocklabs/eslint-config/library.js"], | ||
| parserOptions: { | ||
| projects: ["tsconfig.json"], | ||
| }, |
There was a problem hiding this comment.
ESLint config uses wrong property name projects
Low Severity
The ESLint configuration uses parserOptions.projects (plural) but the correct property name for @typescript-eslint/parser is parserOptions.project (singular). This typo causes ESLint to ignore the TypeScript project configuration, potentially breaking type-aware lint rules that depend on the TypeScript compiler.
| for (const s of schemas) { | ||
| if (typeof s !== "object") { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Early return breaks loop processing remaining schemas
Medium Severity
In getValueCompletions, the for...of loop iterating through schemas uses return; when encountering a non-object schema, which exits the entire method instead of continuing to the next schema. If any schema in the array is a boolean schema (true or false, which are valid JSON Schema values), the method stops early and skips processing all remaining schemas that could provide valid completions.
|
|
||
| private getValueFromLabel(value: string): unknown { | ||
| return JSON.parse(value); | ||
| } |
| // "markdown-it-implicit-figures", | ||
| // "markdown-it-video", | ||
| // "markdown-it-highlightjs", | ||
| // ]; |
There was a problem hiding this comment.



Description
** Describe what, why and how of the changes clearly and concisely. Add any additional useful context or info, as necessary. **
Todos
** List any todo items necessary before merging, if any. Delete if none. **
Checklist
Screenshots or videos
** Attach any screenshots or recordings to visually illustrate the changes, as necessary. Delete if not relevant. **