Fix optional Validator constructor typings - #126
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
| "test": "npm run test:unit && npm run test:types", | ||
| "test:unit": "tap", | ||
| "test:types": "tsc --noEmit --strict src/index.d.ts", | ||
| "test:types": "tsc --noEmit --strict --skipLibCheck types/validator.ts", |
There was a problem hiding this comment.
--skipLibCheck silently skips validating own .d.ts declarations
Medium Severity
The test:types script adds --skipLibCheck, which tells TypeScript to skip type-checking all .d.ts files — including the project's own src/index.d.ts. The old script directly validated src/index.d.ts, so internal type errors in the declaration file (e.g., referencing a nonexistent type or structural mistakes) were caught. Now those errors are silently ignored. The test fixture in types/validator.ts only exercises the consumer-facing API surface, not the internal correctness of the declarations.
|
You have used all of your free Bugbot PR reviews. To receive reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial. |
7324e0e to
b67b140
Compare


Summary
Validatorconstructor options parameter optional in the published TypeScript declarationsnew Validator()andnew Validator({ allErrors: true })Closes #114
Note
Low Risk
Low risk type-only changes plus a TypeScript fixture to prevent regressions; no runtime logic is modified.
Overview
Updates the published TypeScript declarations so
new Validator()is valid by making theValidatorconstructoroptionsparameter optional.Adds a small consumer-style TypeScript fixture in
types/validator.tsand updates thetest:typesscript to compile it, covering both default and configured constructor usage.Written by Cursor Bugbot for commit 1c9bfc2. This will update automatically on new commits. Configure here.