Conversation
- Switch to pnpm - Enable eslint - Add typescript
WalkthroughThis PR introduces TypeScript type-checking support via tsconfig.json, adds JSDoc type annotations across test files, refactors the export style in load.js to use named function declarations, fixes logic bugs in test files (incorrect negation operators), and updates package.json with version bump, publishConfig, bin entry, and devDependencies. Configuration files for ESLint and pnpm workspace are also added. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~23 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 inconclusive)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
package.json (1)
2-36: Remove or update unnecessary devDependencies.
@types/node^22.0.0 is outdated (latest is 25.0.10) and unnecessary—this is a CommonJS project using JSDoc, not TypeScript. Additionally,@kaliber/eslint-pluginappears unused; no eslint configuration exists in the repository. Either remove these dependencies or add the configuration they're meant to support.
🤖 Fix all issues with AI agents
In `@load.js`:
- Around line 84-87: The local variable named "constructor" in function isObject
shadows the global constructor and violates noShadowRestrictedNames; rename it
(e.g., to "ctor" or "cons") by changing const constructor = getConstructor(x) to
const ctor = getConstructor(x) and update the subsequent check (replace uses of
"constructor" with "ctor") so the function isObject and the call to
getConstructor(x) use the new name consistently.
| function isObject(x) { | ||
| const constructor = getConstructor(x) | ||
| return constructor && constructor instanceof constructor | ||
| } |
There was a problem hiding this comment.
Avoid shadowing the global constructor name.
This trips lint (noShadowRestrictedNames) and is easy to fix by renaming the local variable.
🔧 Proposed fix
function isObject(x) {
- const constructor = getConstructor(x)
- return constructor && constructor instanceof constructor
+ const ctor = getConstructor(x)
+ return ctor && ctor instanceof ctor
}📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| function isObject(x) { | |
| const constructor = getConstructor(x) | |
| return constructor && constructor instanceof constructor | |
| } | |
| function isObject(x) { | |
| const ctor = getConstructor(x) | |
| return ctor && ctor instanceof ctor | |
| } |
🧰 Tools
🪛 Biome (2.1.2)
[error] 85-85: Do not shadow the global "constructor" property.
Consider renaming this variable. It's easy to confuse the origin of variables when they're named after a known global.
(lint/suspicious/noShadowRestrictedNames)
🤖 Prompt for AI Agents
In `@load.js` around lines 84 - 87, The local variable named "constructor" in
function isObject shadows the global constructor and violates
noShadowRestrictedNames; rename it (e.g., to "ctor" or "cons") by changing const
constructor = getConstructor(x) to const ctor = getConstructor(x) and update the
subsequent check (replace uses of "constructor" with "ctor") so the function
isObject and the call to getConstructor(x) use the new name consistently.
Summary by CodeRabbit
New Features
kaliber-config) for accessing configuration utilities.Chores
✏️ Tip: You can customize this high-level summary in your review settings.