-
Notifications
You must be signed in to change notification settings - Fork 6
Fix TypeScript compilation errors in security module #491
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,7 +3,7 @@ import type { PluginMetadata } from '../plugin-loader.js'; | |||||
|
|
||||||
| // Conditionally import crypto for Node.js environments | ||||||
| let cryptoModule: typeof import('crypto') | null = null; | ||||||
| if (typeof window === 'undefined') { | ||||||
| if (typeof (globalThis as any).window === 'undefined') { | ||||||
|
||||||
| if (typeof (globalThis as any).window === 'undefined') { | |
| if (typeof process !== 'undefined' && process.versions?.node !== undefined) { |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent logger.error usage within this file. This call uses the 3-parameter signature with undefined as the second parameter, but other calls in the same file (lines 152, 304, 330) use the 2-parameter signature when there's no Error object. For consistency, when logging without an Error object, use the 2-parameter signature: this.logger.error(error, { plugin: plugin.name, publisherId }) instead of this.logger.error(error, undefined, { plugin: plugin.name, publisherId }).
| this.logger.error(error, undefined, { plugin: plugin.name, publisherId }); | |
| this.logger.error(error, { plugin: plugin.name, publisherId }); |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent logger.error usage within this file. This call uses the 3-parameter signature with undefined as the second parameter, but other calls in the same file (lines 152, 304, 330) use the 2-parameter signature when there's no Error object. For consistency, when logging without an Error object, use the 2-parameter signature: this.logger.error(error, { plugin: plugin.name }) instead of this.logger.error(error, undefined, { plugin: plugin.name }).
| this.logger.error(error, undefined, { plugin: plugin.name }); | |
| this.logger.error(error, { plugin: plugin.name }); |
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach using typeof (globalThis as any).window is inconsistent with the codebase pattern for environment detection. A more idiomatic approach would be to check for Node.js using typeof process !== 'undefined' && process.versions?.node !== undefined (as used in logger.ts:27) rather than checking for the absence of window. This is more explicit about detecting the Node.js environment and avoids the type assertion.
Copilot
AI
Feb 2, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The approach using typeof (globalThis as any).window is inconsistent with the codebase pattern for environment detection. A more idiomatic approach would be to check for Node.js using typeof process !== 'undefined' && process.versions?.node !== undefined (as used in logger.ts:27) rather than checking for the absence of window. This is more explicit about detecting the Node.js environment and avoids the type assertion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Inconsistent logger.error usage within this file. This call uses the 3-parameter signature with
undefinedas the second parameter, but other calls in the same file (lines 152, 304, 330) use the 2-parameter signature when there's no Error object. For consistency, when logging without an Error object, use the 2-parameter signature:this.logger.error(errorMessage, { plugin: plugin.name, errors: formattedErrors })instead of the 3-parameter version withundefined.